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:57 +0100
commita0423422b99a8d9051bda2df58d7a31398a8c9bc (patch)
treef5b3e67d12ecf49d9cf8798243ad41494517ffb3 /meta/recipes-connectivity/openssh
parent96310a58672e86b4130866c41b64525a2f9532da (diff)
downloadpoky-a0423422b99a8d9051bda2df58d7a31398a8c9bc.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. (From OE-Core rev: 3ecebc70f957e53e3dcf1cc835ff359115db6e56) Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 @@
1[Unit]
2Description=OpenSSH server daemon
3Wants=sshdgenkeys.service
4After=sshdgenkeys.service
5
6[Service]
7Environment="SSHD_OPTS="
8EnvironmentFile=-/etc/default/ssh
9ExecStartPre=/usr/bin/mkdir -p /var/run/sshd
10ExecStart=-@SBINDIR@/sshd -D $SSHD_OPTS
11ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
12KillMode=process
13Restart=on-failure
14RestartSec=42s
15
16[Install]
17WantedBy=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
16 file://ssh_config \ 16 file://ssh_config \
17 file://init \ 17 file://init \
18 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ 18 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
19 file://sshd.service \
19 file://sshd.socket \ 20 file://sshd.socket \
20 file://sshd@.service \ 21 file://sshd@.service \
21 file://sshdgenkeys.service \ 22 file://sshdgenkeys.service \
@@ -48,7 +49,7 @@ INITSCRIPT_NAME:${PN}-sshd = "sshd"
48INITSCRIPT_PARAMS:${PN}-sshd = "defaults 9" 49INITSCRIPT_PARAMS:${PN}-sshd = "defaults 9"
49 50
50SYSTEMD_PACKAGES = "${PN}-sshd" 51SYSTEMD_PACKAGES = "${PN}-sshd"
51SYSTEMD_SERVICE:${PN}-sshd = "sshd.socket" 52SYSTEMD_SERVICE:${PN}-sshd = "sshd.socket sshd.service"
52 53
53inherit autotools-brokensep ptest 54inherit autotools-brokensep ptest
54 55
@@ -122,6 +123,7 @@ do_install:append () {
122 123
123 install -d ${D}${systemd_system_unitdir} 124 install -d ${D}${systemd_system_unitdir}
124 install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_system_unitdir} 125 install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_system_unitdir}
126 install -c -m 0644 ${WORKDIR}/sshd.service ${D}${systemd_system_unitdir}
125 install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_system_unitdir} 127 install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_system_unitdir}
126 install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_system_unitdir} 128 install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_system_unitdir}
127 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ 129 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \