[Lunar-commits] <moonbase> openssh: Add service files for systemd.
Auke Kok
sofar at foo-projects.org
Mon Jun 13 06:05:48 CEST 2011
commit c106b43642a69d36f4eb0b8a29e4511f92d2c972
Author: Auke Kok <sofar at foo-projects.org>
Date: Mon Jun 13 06:05:48 2011 +0200
openssh: Add service files for systemd.
You'll want to pick the following choices:
ALWAYS: sshd-keys.service (harmful, only runs once EVER)
NEVER: sshd at .service - this is a virtual service that you cannot start
directly
EITHER: sshd.service - for heavy traffic sshd sites (100s of logins per hour)
OR: sshd.socket - Everyone else
---
crypto/openssh/systemd.d/sshd-keys.service | 11 +++++++++++
crypto/openssh/systemd.d/sshd.service | 14 ++++++++++++++
crypto/openssh/systemd.d/sshd.socket | 10 ++++++++++
crypto/openssh/systemd.d/sshd at .service | 11 +++++++++++
4 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/crypto/openssh/systemd.d/sshd-keys.service b/crypto/openssh/systemd.d/sshd-keys.service
new file mode 100644
index 0000000..cc4a70a
--- /dev/null
+++ b/crypto/openssh/systemd.d/sshd-keys.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Create sshd host keys (one time service only)
+
+[Service]
+Type=oneshot
+ExecStart=make -C /etc/ssh server-keys
+ExecStartPost=/bin/ln -s /dev/null /etc/systemd/system/sshd-keys.service
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/crypto/openssh/systemd.d/sshd.service b/crypto/openssh/systemd.d/sshd.service
new file mode 100644
index 0000000..bc12d61
--- /dev/null
+++ b/crypto/openssh/systemd.d/sshd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=OpenSSH Daemon - daemon version
+After=syslog.target
+
+[Service]
+ExecStart=/usr/sbin/sshd -D
+ExecReload=/bin/kill -HUP $MAINPID
+KillMode=process
+Restart=always
+StandardOutput=syslog
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/crypto/openssh/systemd.d/sshd.socket b/crypto/openssh/systemd.d/sshd.socket
new file mode 100644
index 0000000..9c2bbcd
--- /dev/null
+++ b/crypto/openssh/systemd.d/sshd.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=SSH Per-Connection Server - no daemon version
+Conflicts=sshd.service
+
+[Socket]
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/crypto/openssh/systemd.d/sshd at .service b/crypto/openssh/systemd.d/sshd at .service
new file mode 100644
index 0000000..b94be9f
--- /dev/null
+++ b/crypto/openssh/systemd.d/sshd at .service
@@ -0,0 +1,11 @@
+[Unit]
+Description=SSH Per-Connection Server - no daemon version
+After=syslog.target
+
+[Service]
+ExecStart=-/usr/sbin/sshd -i
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
+
+[Install]
+WantedBy=network.target
More information about the Lunar-commits
mailing list