I need my application users to be able to change the machine’s network hostname, preferably without having to reboot.
I happen to be using the 2.8b7 Yokto build with Qt5.9.9 built in to it, which I baked myself. There’s a few things I altered in the build, but it’s based on the standard Angstrom image.
Typically, I’d use the *hostname * command, edit the /etc/hostname file and edit the /etc/hosts file. This is the sort of thing I’d do in any Linux distribution. Or maybe I’d use the *hostnamectl set-hostname * command instead, since it updates the /etc/hostname file for me.
It doesn’t work. The moment I either edit the /etc/hosts file or issue the hostname or hostnamectl commands, I lose the ability to use any of the apps in the menu (i.e.: PCManFM, for example) - they stop working. My application suffers a segfault when my code tries to change the hostname, too.
This wasn’t an issue in build 2.6. What am I missing?
Any help gratefully appreciated - thank you!
#Change the hostname
hostnamectl set-hostname "$newname"
#Update /etc/hosts
sed -i "s/$oldname/$newname/g" /etc/hosts #Or do it manually with LeafPad
#At this point, try clicking on the menu and opening a built-in app, such as Florence or PCManFM - it won't open.
#My segfaulting Qt app reports "no protocol" or something like that