summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssh
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2023-10-12 14:10:14 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-19 13:38:54 +0100
commit3ecebc70f957e53e3dcf1cc835ff359115db6e56 (patch)
tree416df1c75e4b3c8672fee0744db24bedd264202a /meta/recipes-connectivity/openssh
parent7f05760debd3aeb69c3294f3ceb92d4f1aceec1f (diff)
downloadopenembedded-core-3ecebc70f957e53e3dcf1cc835ff359115db6e56.tar.gz
openssh: Add sshd.service
For systems with a large amount of SSH traffic, it shoule be better to run a single SSH server for all incoming connections. And both sshd.socket and sshd.service are deployed on other distros like ubuntu, fedora and etc. So add sshd.service to make it possible to run a standalone SSH server. Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Diffstat (limited to 'meta/recipes-connectivity/openssh')
-rw-r--r--meta/recipes-connectivity/openssh/openssh/sshd.service17
-rw-r--r--meta/recipes-connectivity/openssh/openssh_9.5p1.bb4
2 files changed, 20 insertions, 1 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh/sshd.service b/meta/recipes-connectivity/openssh/openssh/sshd.service
new file mode 100644
index 0000000000..6ace67d8ae
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/sshd.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=OpenSSH server daemon
+Wants=sshdgenkeys.service
+After=sshdgenkeys.service
+
+[Service]
+Environment="SSHD_OPTS="
+EnvironmentFile=-/etc/default/ssh
+ExecStartPre=/usr/bin/mkdir -p /var/run/sshd
+ExecStart=-@SBINDIR@/sshd -D $SSHD_OPTS
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+KillMode=process
+Restart=on-failure
+RestartSec=42s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/openssh/openssh_9.5p1.bb b/meta/recipes-connectivity/openssh/openssh_9.5p1.bb
index 67087c5157..3a94633cf0 100644
--- a/meta/recipes-connectivity/openssh/openssh_9.5p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_9.5p1.bb
@@ -16,6 +16,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
file://ssh_config \
file://init \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+ file://sshd.service \
file://sshd.socket \
file://sshd@.service \
file://sshdgenkeys.service \
@@ -48,7 +49,7 @@ INITSCRIPT_NAME:${PN}-sshd = "sshd"
INITSCRIPT_PARAMS:${PN}-sshd = "defaults 9"
SYSTEMD_PACKAGES = "${PN}-sshd"
-SYSTEMD_SERVICE:${PN}-sshd = "sshd.socket"
+SYSTEMD_SERVICE:${PN}-sshd = "sshd.socket sshd.service"
inherit autotools-brokensep ptest
@@ -122,6 +123,7 @@ do_install:append () {
install -d ${D}${systemd_system_unitdir}
install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_system_unitdir}
+ install -c -m 0644 ${WORKDIR}/sshd.service ${D}${systemd_system_unitdir}
install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_system_unitdir}
install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_system_unitdir}
sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \