]> code.ossystems Code Review - openembedded-core.git/commit
openssh: Fix key generation with systemd
authorJoshua Watt <jpewhacker@gmail.com>
Tue, 4 Jul 2017 01:18:18 +0000 (20:18 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 25 Sep 2017 13:14:02 +0000 (14:14 +0100)
commit7e49c5879862253ae1b6a26535d07a2740a95798
tree49f5f94d957b08a1ce8a3aff6e7e2eda277ec4e0
parent8c1dec627e9735260516fe8f0b2bfdb0ee70172b
openssh: Fix key generation with systemd

106b59d9 broke SSH host key generation when systemd and a read-only root file
system are in use because there isn't a way for systemd to get the optional
weak assigment of SYSCONFDIR from /etc/default/sshd and still provide a default
value if it is not specified. Instead, move the logic for determining if keys
need to be created to a helper script that both the SysV init script and the
systemd unit file can reference.

This does mean that the systemd unit file can't check for file existence to
know if it should start the service, but it wasn't able to do that correctly
anyway anymore. This should be a problem since the serivce is only run once per
power cycle by systemd, and should exit quickly if the keys already exist

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-connectivity/openssh/openssh/init
meta/recipes-connectivity/openssh/openssh/sshd_check_keys [new file with mode: 0644]
meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
meta/recipes-connectivity/openssh/openssh_7.5p1.bb