All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 5/5] Add the systemd units files to openssh
Date: Fri,  3 Feb 2012 15:27:27 +0100	[thread overview]
Message-ID: <1328279247-7277-6-git-send-email-maxime.ripard@free-electrons.com> (raw)
In-Reply-To: <1328279247-7277-1-git-send-email-maxime.ripard@free-electrons.com>

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 package/openssh/openssh.mk    |   19 ++++++++++++++++---
 package/openssh/sshd.socket   |    9 +++++++++
 package/openssh/sshd at .service |    7 +++++++
 3 files changed, 32 insertions(+), 3 deletions(-)
 create mode 100644 package/openssh/sshd.socket
 create mode 100644 package/openssh/sshd at .service

diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
index 08bb499..652e1d1 100644
--- a/package/openssh/openssh.mk
+++ b/package/openssh/openssh.mk
@@ -12,10 +12,23 @@ OPENSSH_CONF_OPT = --libexecdir=/usr/lib --disable-lastlog --disable-utmp \
 
 OPENSSH_DEPENDENCIES = zlib openssl
 
-define OPENSSH_INSTALL_INITSCRIPT
-	$(INSTALL) -D -m 755 package/openssh/S50sshd $(TARGET_DIR)/etc/init.d/S50sshd
+define OPENSSH_INSTALL_INIT_SYSV
+if [! -f $(TARGET_DIR)/etc/init.d/S50sshd ]; then \
+	$(INSTALL) -D -m 755 package/openssh/S50sshd $(TARGET_DIR)/etc/init.d/S50sshd; \
+fi;
 endef
 
-OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_INITSCRIPT
+define OPENSSH_INSTALL_INIT_SYSTEMD
+[ -f $(TARGET_DIR)/etc/systemd/system/sshd.socket ] || \
+	$(INSTALL) -D -m 755 package/openssh/sshd.socket \
+		$(TARGET_DIR)/etc/systemd/system/sshd.socket
+
+[ -f $(TARGET_DIR)/etc/systemd/system/sshd at .service ] || \
+	$(INSTALL) -D -m 755 package/openssh/sshd at .service \
+		$(TARGET_DIR)/etc/systemd/system/sshd at .service
+
+mkdir -p $(TARGET_DIR)/etc/systemd/system/sockets.target.wants
+ln -fs ../sshd.socket $(TARGET_DIR)/etc/systemd/system/sockets.target.wants/sshd.socket
+endef
 
 $(eval $(call AUTOTARGETS))
diff --git a/package/openssh/sshd.socket b/package/openssh/sshd.socket
new file mode 100644
index 0000000..fd68407
--- /dev/null
+++ b/package/openssh/sshd.socket
@@ -0,0 +1,9 @@
+[Unit]
+Conflicts=sshd.service
+
+[Socket]
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/package/openssh/sshd at .service b/package/openssh/sshd at .service
new file mode 100644
index 0000000..b81d471
--- /dev/null
+++ b/package/openssh/sshd at .service
@@ -0,0 +1,7 @@
+[Unit]
+Description=SSH Per-Connection Server
+After=syslog.target
+
+[Service]
+ExecStart=/usr/sbin/sshd -i
+StandardInput=socket
-- 
1.7.5.4

      parent reply	other threads:[~2012-02-03 14:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 14:27 [Buildroot] [RFC v2] Add systemd to buildroot Maxime Ripard
2012-02-03 14:27 ` [Buildroot] [PATCH 1/5] Add the systemd package Maxime Ripard
2012-02-03 20:32   ` Peter Korsgaard
2012-02-04 13:13     ` Maxime Ripard
2012-02-05  9:58       ` Peter Korsgaard
2012-02-03 14:27 ` [Buildroot] [PATCH 2/5] Rework of the init system Maxime Ripard
2012-02-09 23:12   ` Arnout Vandecappelle
2012-02-03 14:27 ` [Buildroot] [PATCH 3/5] Fix installation for the lighttpd package Maxime Ripard
2012-02-03 14:27 ` [Buildroot] [PATCH 4/5] Add systemd unit for lighttpd Maxime Ripard
2012-02-03 14:27 ` Maxime Ripard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328279247-7277-6-git-send-email-maxime.ripard@free-electrons.com \
    --to=maxime.ripard@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.