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...
 


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
 
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...
 
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?
 

Staff online


Top