]> code.ossystems Code Review - openembedded-core.git/commitdiff
openssh: fixes for systemd
authorChen Qi <Qi.Chen@windriver.com>
Fri, 17 Jan 2014 03:03:22 +0000 (22:03 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 28 Jan 2014 00:48:24 +0000 (00:48 +0000)
This patch contains a few fixes for the systemd unit files of openssh.
The fixes use the same unit files in Fedora 20 as a reference.

1) Remove sshdgenkeys.service and sshd@.service from SYSTEMD_SERVICE.
2) Fix the dependency and logic of sshdgenkeys.service.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-connectivity/openssh/openssh-6.4p1/sshd.socket
meta/recipes-connectivity/openssh/openssh-6.4p1/sshd@.service
meta/recipes-connectivity/openssh/openssh-6.4p1/sshdgenkeys.service
meta/recipes-connectivity/openssh/openssh_6.4p1.bb

index d19ab2ac43bccff54fddf2fee9e249d3d8dac440..12c39b26b59b2ed4be08e7fbbfd054a2aa811f3a 100644 (file)
@@ -8,4 +8,3 @@ Accept=yes
 
 [Install]
 WantedBy=sockets.target
-Also=sshdgenkeys.service
index 64e009ff0045e450fbac3db4a6261aefdaca1236..4eda6592f5d32811861f4782a0af88680637b1b1 100644 (file)
@@ -1,5 +1,6 @@
 [Unit]
 Description=OpenSSH Per-Connection Daemon
+Wants=sshdgenkeys.service
 After=sshdgenkeys.service
 
 [Service]
index 2fd8a9aaf214128c1974434aa5229217f41afe60..c21d70baf0a9a03eb9e2fcb2b83a8e74574d08bb 100644 (file)
@@ -1,10 +1,10 @@
 [Unit]
-Description=SSH Key Generation
+Description=OpenSSH Key Generation
+ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key
 
 [Service]
 ExecStart=@BINDIR@/ssh-keygen -A
 Type=oneshot
 RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target
index c61d16f6c6690b3a21b0760c1abfd906ea0d3f36..1f78566c6c0abd059c80cf7d5fa97fe5556403a5 100644 (file)
@@ -44,7 +44,7 @@ INITSCRIPT_NAME_${PN}-sshd = "sshd"
 INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
 
 SYSTEMD_PACKAGES = "${PN}-sshd"
-SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket sshd@.service sshdgenkeys.service"
+SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket"
 
 PACKAGECONFIG ??= "tcp-wrappers"
 PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,,tcp-wrappers"
@@ -114,7 +114,7 @@ ALLOW_EMPTY_${PN} = "1"
 PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
 FILES_${PN}-scp = "${bindir}/scp.${BPN}"
 FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
-FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd"
+FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd ${systemd_unitdir}/system"
 FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd"
 FILES_${PN}-sftp = "${bindir}/sftp"
 FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"