#1286 PR merged: Fix no hostname set in Arch Linux #1254

Labels: enhancement, bug, fixed / solved / done

ProBackup-nl opened issue at 2017-04-13 09:25:

By storing the hostname in /etc/hostname (lowercase) Arch Linux will automatically set the host name in the recovery environment. See issue #1254

jsmeix commented at 2017-04-13 09:32:

So clean and simple that I cannot imagine
what could go wrong so that I "just merge" it.

ProBackup-nl commented at 2017-04-13 10:07:

The thing that can go wrong are systems / Linux distributions where /etc/hostname (lowercase) exists and that don't automagically set the system and shell hostname from it.

jsmeix commented at 2017-04-13 12:50:

Perhaps we could have a script that is run
during recovery system startup or at least
during "rear recover" (e.g. in usr/share/rear/verify/ )
that checks if $HOSTNAME is the vaule of
/etc/HOSTNAME or /etc/hostname
and if not explicitly sets it to that value
as it happens now in /etc/scripts/boot
which is no longer run in case of systemd
as far as it seems to me, cf.
https://github.com/rear/rear/pull/1287#issuecomment-293884141

ProBackup-nl commented at 2017-04-13 13:07:

Another situation where this can go wrong is a non Arch Linux where the user has created both /etc/hostname and /etc/HOSTNAME on their source system.

Now Rear will assume /etc/hostname does the host name setting magic. Where the system actually might need /etc/HOSTNAME.

Do we need to address such exceptional cases?

If the answer is yes, then https://github.com/rear/rear/pull/1286#issuecomment-293886273 to run some scripting to repair the situation, seems ok.

jsmeix commented at 2017-04-18 10:09:

Murphy's law:
I wrote
"So clean and simple that I cannot imagine what could go wrong"
and things went wrong (in particular on SLES12):
https://github.com/rear/rear/pull/1316


[Export of Github issue for rear/rear.]