Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix no hostname set in Arch Linux #1254 #1286

Merged
merged 1 commit into from Apr 13, 2017
Merged

Conversation

ProBackup-nl
Copy link
Contributor

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

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

@jsmeix jsmeix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean and simple so that
even I can directyl understand
what that code is meant to do ;-)

@jsmeix jsmeix self-assigned this Apr 13, 2017
@jsmeix jsmeix added cleanup enhancement Adaptions and new features labels Apr 13, 2017
@jsmeix jsmeix added this to the ReaR v2.1 milestone Apr 13, 2017
@jsmeix
Copy link
Member

jsmeix commented Apr 13, 2017

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

@jsmeix jsmeix merged commit 363eba7 into rear:master Apr 13, 2017
@jsmeix jsmeix added bug The code does not do what it is meant to do fixed / solved / done and removed cleanup labels Apr 13, 2017
ProBackup-nl pushed a commit to ProBackup-nl/rear that referenced this pull request Apr 13, 2017
After merging issue rear#1286 this enhancement beautifies the recovery environment scripting, to not run unnecessary code for:
1. cases where /etc/HOSTNAME does not exist
2. things that the operating system already has taken care of.

Target: Arch Linux
Hostname set in /etc/hostname (lowercase)
Only that /etc/hostname file present, will already set the hostname in (1) system and (2) shell for Arch Linux, without the need for this script to set any of these 2.
@ProBackup-nl
Copy link
Contributor Author

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
Copy link
Member

jsmeix commented Apr 13, 2017

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.
#1287 (comment)

@ProBackup-nl
Copy link
Contributor Author

ProBackup-nl commented Apr 13, 2017

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 #1286 (comment) to run some scripting to repair the situation, seems ok.

@jsmeix
Copy link
Member

jsmeix commented Apr 18, 2017

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):
#1316

jsmeix added a commit that referenced this pull request Apr 19, 2017
Set hostname in both /etc/hostname and /etc/HOSTNAME.
Some Linux distributions use /etc/hostname (e.g. Arch Linux)
but others use /etc/HOSTNAME (e.g. Red Hat and SUSE)
so that both are provided in the recovery system
to be on the safe side
cf. #1316
and #1286
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The code does not do what it is meant to do enhancement Adaptions and new features fixed / solved / done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants