Patchwork [meta-oe] openssh_5.9p1.bbappend: add systemd units

login
register
mail settings
Submitter Martin Jansa
Date Dec. 12, 2011, 4:23 p.m.
Message ID <1323706995-23065-1-git-send-email-Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/16751/
State Accepted
Commit e550e77ca9956911ec1212984b1aac2d05e4e650
Headers show

Comments

Martin Jansa - Dec. 12, 2011, 4:23 p.m.
From: Klaus Kurzmann <mok@fluxnetz.de>

Signed-off-by: Klaus Kurzmann <mok@fluxnetz.de>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 .../openssh/openssh/sshd.socket                    |   11 ++++++++++
 .../openssh/openssh/sshd@.service                  |    9 ++++++++
 .../openssh/openssh/sshdgenkeys.service            |   10 +++++++++
 .../openssh/openssh_5.9p1.bbappend                 |   22 ++++++++++++++++++++
 4 files changed, 52 insertions(+), 0 deletions(-)
 create mode 100644 meta-oe/recipes-connectivity/openssh/openssh/sshd.socket
 create mode 100644 meta-oe/recipes-connectivity/openssh/openssh/sshd@.service
 create mode 100644 meta-oe/recipes-connectivity/openssh/openssh/sshdgenkeys.service
 create mode 100644 meta-oe/recipes-connectivity/openssh/openssh_5.9p1.bbappend

Patch

diff --git a/meta-oe/recipes-connectivity/openssh/openssh/sshd.socket b/meta-oe/recipes-connectivity/openssh/openssh/sshd.socket
new file mode 100644
index 0000000..753a33b
--- /dev/null
+++ b/meta-oe/recipes-connectivity/openssh/openssh/sshd.socket
@@ -0,0 +1,11 @@ 
+[Unit]
+Conflicts=sshd.service
+
+[Socket]
+ExecStartPre=/bin/mkdir -p /var/run/sshd
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
+Also=sshdgenkeys.service
diff --git a/meta-oe/recipes-connectivity/openssh/openssh/sshd@.service b/meta-oe/recipes-connectivity/openssh/openssh/sshd@.service
new file mode 100644
index 0000000..d118490
--- /dev/null
+++ b/meta-oe/recipes-connectivity/openssh/openssh/sshd@.service
@@ -0,0 +1,9 @@ 
+[Unit]
+Description=OpenSSH Per-Connection Daemon
+After=sshdgenkeys.service
+
+[Service]
+ExecStart=-/usr/sbin/sshd -i
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+StandardError=syslog
diff --git a/meta-oe/recipes-connectivity/openssh/openssh/sshdgenkeys.service b/meta-oe/recipes-connectivity/openssh/openssh/sshdgenkeys.service
new file mode 100644
index 0000000..c717214
--- /dev/null
+++ b/meta-oe/recipes-connectivity/openssh/openssh/sshdgenkeys.service
@@ -0,0 +1,10 @@ 
+[Unit]
+Description=SSH Key Generation
+
+[Service]
+ExecStart=/usr/bin/ssh-keygen -A
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-oe/recipes-connectivity/openssh/openssh_5.9p1.bbappend b/meta-oe/recipes-connectivity/openssh/openssh_5.9p1.bbappend
new file mode 100644
index 0000000..3f68e09
--- /dev/null
+++ b/meta-oe/recipes-connectivity/openssh/openssh_5.9p1.bbappend
@@ -0,0 +1,22 @@ 
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+PRINC := "${@int(PRINC) + 1}"
+
+SYSTEMD_PACKAGES = "openssh-sshd-systemd"
+SYSTEMD_SERVICE = "sshd.socket"
+
+inherit systemd
+
+SRC_URI += "file://sshd.socket file://sshd@.service file://sshdgenkeys.service"
+
+do_install_append() {
+       install -d ${D}${base_libdir}/systemd/system
+       install -m 644 ${WORKDIR}/sshd.socket ${D}${base_libdir}/systemd/system
+       install -m 644 ${WORKDIR}/sshd@.service ${D}${base_libdir}/systemd/system
+       install -m 644 ${WORKDIR}/sshdgenkeys.service ${D}${base_libdir}/systemd/system
+}
+
+PACKAGES =+ "openssh-sshd-systemd"
+
+FILES_openssh-sshd-systemd += "${base_libdir}/systemd"
+RDEPENDS_openssh-sshd-systemd += "openssh-sshd"