[packages/systemd] do not inherit $HOSTNAME when setting up /etc/hostname in systemd-units post scriptlet

Jeffrey Johnson n3npq at me.com
Thu Jun 4 15:03:57 CEST 2015


> On Jun 3, 2015, at 10:14 AM, Jacek Konieczny <jajcus at jajcus.net> wrote:
> 
> On 2015-06-03 15:57, Elan Ruusamäe wrote:
>> 
>>  the previous code caused permission issues in docker:
>> 
>> [root at localhost] # docker run -i -t pld bash
>> [root at fee5a8d66c6a /]# echo $HOSTNAME
>> fee5a8d66c6a
>> [root at fee5a8d66c6a /]# cat /etc/hostname
>> fee5a8d66c6a
>> [root at fee5a8d66c6a /]# poldek -u systemd-units
>> 5:systemd-units ###########################################
>> mv: cannot move '/etc/hostname' to '/etc/hostname.rpmsave': Device or
>> resource busy
>> Operation failed: No such file or directory
>> [root at fee5a8d66c6a /]# ls -l /etc/sysconfig/network /etc/hostname
>> ls: cannot access /etc/sysconfig/network: No such file or directory
>> -rw-r--r-- 1 root root 13 Jun  3 13:52 /etc/hostname
>> [root at fee5a8d66c6a /]# grep hostname /proc/mounts
>> /dev/mapper/sys-docker /etc/hostname xfs
>> rw,relatime,attr2,inode64,noquota 0 0
>> 
>> 
>> 
>> why set up the file at all if the file already exists and is not-empty?
> 
> Exactly! If the file is there, then it must not me touched! That is an important part of the system configuration.
> 

Are you creating an immutable file?

If so, the rpm likely needs to provide a better error message when there
is an attempt to replace an immutable file from a package.

73 de Jeff



More information about the pld-devel-en mailing list