-
Notifications
You must be signed in to change notification settings - Fork 21
split out OS release and SSH key info into separate service units #57
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
Conversation
@rfairley Could you please rebase this PR against the latest master? |
Split the definitions of {ETC,RUN,USR_LIB}_SNIPPETS into a .defs file, aligning closer with issuegen and thinning out the motdgen script. Prep for splitting out other parts of motdgen such as the OS release info snippet.
This file need not be executable as it is only sourced into scripts and not directly executed. Move out of `usr/libexec` and into `usr/lib`. Update permission bits to be non-executable, and while at it fix the shebang to use the full path (as RPM will mangle the symlinked path to use the fully qualified path). also unset its executable bit, as this file is only sourced, and remove set bash flags and fix its shebang
Further align issuegen.defs with motdgen.defs by sourcing environment variables from `usr/lib/libutil.sh` and de-capitalizing local variables.
…essages Install files under /usr/lib/console-login-helper-messages which includes definitions and utility scripts, sourced by executables.
Split out the SSH key snippet generation into a single-purpose script run by its own unit. The unit runs only once per boot on startup, after `ssh-keygen.target` is met, which is the same refresh mechanism as originally guaranteed by issuegen. SSH keys should not be changed for a machine, and so regenerating the keys once on boot should be sufficient. Overall, this decouples extra work issuegen does if it was triggered for another reason (e.g. the udev rule for network interfaces); the SSH key info snippet need not be regenerated.
Similar as done for SSH keys in issuegen, split out the OS release generation into its own script and unit. The info shown from the OS release file need only be regenerated once on boot, as this information is not expected to change.
Give additional explanation on how the "gensnippet" units, split out from issuegen/motdgen, fit into the overall picture. Add these units to the sections on enabling/disabling messages.
Update this script to activate the recently split out services on startup.
Each SSH invocation takes some time to connect to the VM - mitigate this by connecting fewer times and executing more commands within each `ssh` invocation. While at it, be more consistent with variable expansion and quoting.
Update this script to enable the split out OS release and SSH keys units.
8f30cd1
to
912f0c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Tested the changes locally (using https://github.com/coreos/console-login-helper-messages/blob/master/README-devel.md#testing-changes-in-a-virtual-machine) and things seem to be working as expected.
Thanks for pushing this one through and rebasing! LGTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Remove preset for CLHM-{issuegn,motdgen}.service since the `.path` units are now the only triggers to run the `-issuegen.service` and `-motdgen.service` units. coreos/console-login-helper-messages#55 Add preset to enable `CLHM-gensnippet-os-release.service` and `CLHM-gensnippet-ssh-keys.service` units. These are new units that were split out from `issuegen.service` and `motdgen.service`, and should be enabled by default. coreos/console-login-helper-messages#57 This was added in the v0.19 release: https://github.com/coreos/console-login-helper-messages/releases/tag/v0.19
Remove preset for CLHM-{issuegn,motdgen}.service since the `.path` units are now the only triggers to run the `-issuegen.service` and `-motdgen.service` units. coreos/console-login-helper-messages#55 Add preset to enable `CLHM-gensnippet-os-release.service` and `CLHM-gensnippet-ssh-keys.service` units. These are new units that were split out from `issuegen.service` and `motdgen.service`, and should be enabled by default. coreos/console-login-helper-messages#57 This was added in the v0.19 release: https://github.com/coreos/console-login-helper-messages/releases/tag/v0.19
Remove preset for CLHM-{issuegn,motdgen}.service since the `.path` units are now the only triggers to run the `-issuegen.service` and `-motdgen.service` units. coreos/console-login-helper-messages#55 Add preset to enable `CLHM-gensnippet-os-release.service` and `CLHM-gensnippet-ssh-keys.service` units. These are new units that were split out from `issuegen.service` and `motdgen.service`, and should be enabled by default. coreos/console-login-helper-messages#57 This was added in the v0.19 release: https://github.com/coreos/console-login-helper-messages/releases/tag/v0.19
Remove preset for CLHM-{issuegn,motdgen}.service since the `.path` units are now the only triggers to run the `-issuegen.service` and `-motdgen.service` units. coreos/console-login-helper-messages#55 Add preset to enable `CLHM-gensnippet-os-release.service` and `CLHM-gensnippet-ssh-keys.service` units. These are new units that were split out from `issuegen.service` and `motdgen.service`, and should be enabled by default. coreos/console-login-helper-messages#57 This was added in the v0.19 release: https://github.com/coreos/console-login-helper-messages/releases/tag/v0.19
Following on #56 and #44, split out
console-login-helper-messages-gensnippet-os-release.service
andconsole-login-helper-messages-gensnippet-ssh-keys.service
into separate units which use thePathChanged=
/PathExistsGlob=
detection provided by the.path
units. These services run once on boot (which had been the case when they were part of the-issuegen
and-motdgen
scripts..defs
files are also moved tousr/lib/console-login-helper-messages
as these are non-executable. Docs and development scripts are updated accordingly.