• We did not send an email asking for donations - please read this post.

hostnamed with read only file system

UglyBob

New Member
Joined
Oct 4, 2017
Messages
4
Reaction score
0
Credits
0
I'm working with an embedded system where we have now set our file system to read only to protect the flash. I still want to be able to change the hostname dynamically, as it is useful to see in journal logs what device it is. Before read only file system I used hostnamed and set both the static and the dynamic hostname. Now the static hostname command of course complains that it can't write to the file system, which is not weird.

So I thought I would just remove the static call and be fine with the dynamic as I set it every boot. Boot then I noticed that the hostname is not changed for either the prompt nor the journal logs. But if I call the static one, it complains but still sets it somewhere and it works.

Looking at the source, I can not figure out what the static call does that the dynamic doesn't...
 


wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
7,836
Reaction score
6,661
Credits
29,051
Hey @UglyBob welcome to linux.org:)

I'm from Australia and off for the night, but I expect someone will be along soon or else I will look into this Saturday morning my time.

Cheers

Chris Turner
wizardfromoz
 
OP
U

UglyBob

New Member
Joined
Oct 4, 2017
Messages
4
Reaction score
0
Credits
0
Hi!

I'm using Yocto and I tried that grep with empty result. I actually is going another way now and is trying to symlink the /etc/hostname to a writable area. So maybe I don't need to solve this issue anyway...
 
OP
U

UglyBob

New Member
Joined
Oct 4, 2017
Messages
4
Reaction score
0
Credits
0
Actually symlink didn't work either, I guess hostnamed checks the status of the file system before trying to write and the symlink still resides at the read only fs. Because I can definitely write to the file manually myself now. Any other ideas how to solve this?
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top