Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv4] openssh: add systemd unit file
@ 2013-11-20 12:27 Gustavo Zacarias
  2013-12-04 10:08 ` Samuel Martin
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo Zacarias @ 2013-11-20 12:27 UTC (permalink / raw)
  To: buildroot

And only install sysV-style script when appropiate.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/openssh/openssh.mk   | 13 ++++++++++---
 package/openssh/sshd.service | 11 +++++++++++
 2 files changed, 21 insertions(+), 3 deletions(-)
 create mode 100644 package/openssh/sshd.service

diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
index 8ab2b47..faf2368 100644
--- a/package/openssh/openssh.mk
+++ b/package/openssh/openssh.mk
@@ -17,10 +17,17 @@ OPENSSH_DEPENDENCIES += linux-pam
 OPENSSH_CONF_OPT += --with-pam
 endif
 
-define OPENSSH_INSTALL_INITSCRIPT
-	$(INSTALL) -D -m 755 package/openssh/S50sshd $(TARGET_DIR)/etc/init.d/S50sshd
+define OPENSSH_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 755 package/openssh/sshd.service \
+		$(TARGET_DIR)/etc/systemd/system/sshd.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs ../sshd.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/sshd.service
 endef
 
-OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_INITSCRIPT
+define OPENSSH_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 package/openssh/S50sshd \
+		$(TARGET_DIR)/etc/init.d/S50sshd
+endef
 
 $(eval $(autotools-package))
diff --git a/package/openssh/sshd.service b/package/openssh/sshd.service
new file mode 100644
index 0000000..b5e96b3
--- /dev/null
+++ b/package/openssh/sshd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenSSH server daemon
+After=syslog.target network.target auditd.service
+
+[Service]
+ExecStartPre=/usr/bin/ssh-keygen -A
+ExecStart=/usr/sbin/sshd -D -e
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCHv4] openssh: add systemd unit file
  2013-11-20 12:27 [Buildroot] [PATCHv4] openssh: add systemd unit file Gustavo Zacarias
@ 2013-12-04 10:08 ` Samuel Martin
  2013-12-04 10:19   ` Gustavo Zacarias
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Martin @ 2013-12-04 10:08 UTC (permalink / raw)
  To: buildroot

Hi Gustavo,

2013/11/20 Gustavo Zacarias <gustavo@zacarias.com.ar>

> And only install sysV-style script when appropiate.
>
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
>  package/openssh/openssh.mk   | 13 ++++++++++---
>  package/openssh/sshd.service | 11 +++++++++++
>  2 files changed, 21 insertions(+), 3 deletions(-)
>  create mode 100644 package/openssh/sshd.service
>
> diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
> index 8ab2b47..faf2368 100644
> --- a/package/openssh/openssh.mk
> +++ b/package/openssh/openssh.mk
> @@ -17,10 +17,17 @@ OPENSSH_DEPENDENCIES += linux-pam
>  OPENSSH_CONF_OPT += --with-pam
>  endif
>
> -define OPENSSH_INSTALL_INITSCRIPT
> -       $(INSTALL) -D -m 755 package/openssh/S50sshd
> $(TARGET_DIR)/etc/init.d/S50sshd
> +define OPENSSH_INSTALL_INIT_SYSTEMD
> +       $(INSTALL) -D -m 755 package/openssh/sshd.service \
>
Any specific reason to make sshd.service executable?


> +               $(TARGET_DIR)/etc/systemd/system/sshd.service
> +       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> +       ln -fs ../sshd.service \
> +
> $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/sshd.service
>  endef
>
> -OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_INITSCRIPT
> +define OPENSSH_INSTALL_INIT_SYSV
> +       $(INSTALL) -D -m 755 package/openssh/S50sshd \
> +               $(TARGET_DIR)/etc/init.d/S50sshd
> +endef
>
>  $(eval $(autotools-package))
> diff --git a/package/openssh/sshd.service b/package/openssh/sshd.service
> new file mode 100644
> index 0000000..b5e96b3
> --- /dev/null
> +++ b/package/openssh/sshd.service
> @@ -0,0 +1,11 @@
> +[Unit]
> +Description=OpenSSH server daemon
> +After=syslog.target network.target auditd.service
> +
> +[Service]
> +ExecStartPre=/usr/bin/ssh-keygen -A
> +ExecStart=/usr/sbin/sshd -D -e
> +ExecReload=/bin/kill -HUP $MAINPID
> +
> +[Install]
> +WantedBy=multi-user.target
> --
> 1.8.3.2
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>

Otherwise, it looks good to me.

Regards,


-- 
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20131204/8974e81a/attachment.html>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCHv4] openssh: add systemd unit file
  2013-12-04 10:08 ` Samuel Martin
@ 2013-12-04 10:19   ` Gustavo Zacarias
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo Zacarias @ 2013-12-04 10:19 UTC (permalink / raw)
  To: buildroot

On 12/04/2013 07:08 AM, Samuel Martin wrote:
> Any specific reason to make sshd.service executable?

Inertia from looking at what the lightttpd package does (755 also).
But yes, that's wrong, i'll fix both.
Regards.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-04 10:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-20 12:27 [Buildroot] [PATCHv4] openssh: add systemd unit file Gustavo Zacarias
2013-12-04 10:08 ` Samuel Martin
2013-12-04 10:19   ` Gustavo Zacarias

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox