[OE-core] [PATCH v3] sshd: add sshd.service
Zheng, Ruoqin
zhengrq.fnst at cn.fujitsu.com
Tue Jul 24 02:37:32 UTC 2018
Hi Ross:
I want to add this for in Ubuntu and Fedora, sshd.socket and sshd.service can both coexist.
So, maybe we provide both of them, and user can choose the way they want.
--------------------------------------------------
Zheng Ruoqin
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue,
Nanjing, 210012, China
MAIL : zhengrq.fnst at cn.fujistu.com
-----Original Message-----
From: Burton, Ross [mailto:ross.burton at intel.com]
Sent: Monday, July 23, 2018 6:18 PM
To: Zheng, Ruoqin/郑 若钦 <zhengrq.fnst at cn.fujitsu.com>
Cc: OE-core <openembedded-core at lists.openembedded.org>
Subject: Re: [OE-core] [PATCH v3] sshd: add sshd.service
Still no explanation why you'd want to do this and not use socket activation.
Ross
On 23 July 2018 at 10:02, Zheng Ruoqin <zhengrq.fnst at cn.fujitsu.com> wrote:
> Add sshd.service for user to start the sshd daemon.
>
> Signed-off-by: Zheng Ruoqin <zhengrq.fnst at cn.fujitsu.com>
> ---
> meta/recipes-connectivity/openssh/openssh/sshd.service | 16 ++++++++++++++++
> meta/recipes-connectivity/openssh/openssh_7.7p1.bb | 6 ++++++
> 2 files changed, 22 insertions(+)
> create mode 100644
> meta/recipes-connectivity/openssh/openssh/sshd.service
>
> diff --git a/meta/recipes-connectivity/openssh/openssh/sshd.service
> b/meta/recipes-connectivity/openssh/openssh/sshd.service
> new file mode 100644
> index 0000000..2d2717d
> --- /dev/null
> +++ b/meta/recipes-connectivity/openssh/openssh/sshd.service
> @@ -0,0 +1,16 @@
> +[Unit]
> +Description=OpenSSH server daemon
> +Wants=sshdgenkeys.service
> +After=sshdgenkeys.service
> +
> +[Service]
> +Environment="SSHD_OPTS="
> +EnvironmentFile=-/etc/default/ssh
> +ExecStart=- at SBINDIR@/sshd -i $SSHD_OPTS ExecReload=@BASE_BINDIR@/kill
> +-HUP $MAINPID KillMode=process Restart=on-failure RestartSec=42s
> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/meta/recipes-connectivity/openssh/openssh_7.7p1.bb
> b/meta/recipes-connectivity/openssh/openssh_7.7p1.bb
> index b3da5f6..b4f4c6d 100644
> --- a/meta/recipes-connectivity/openssh/openssh_7.7p1.bb
> +++ b/meta/recipes-connectivity/openssh/openssh_7.7p1.bb
> @@ -17,6 +17,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
> file://ssh_config \
> file://init \
> ${@bb.utils.contains('DISTRO_FEATURES', 'pam',
> '${PAM_SRC_URI}', '', d)} \
> + ${@bb.utils.contains('SSHD_DAEMON', 'service',
> + '${SSHD_DAEMON_SRC_URI}', '', d)} \
> file://sshd.socket \
> file://sshd@.service \
> file://sshdgenkeys.service \ @@ -30,6 +31,8 @@ SRC_URI =
> "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
>
> PAM_SRC_URI = "file://sshd"
>
> +SSHD_DAEMON_SRC_URI = "file://sshd.service"
> +
> SRC_URI[md5sum] = "68ba883aff6958297432e5877e9a0fe2"
> SRC_URI[sha256sum] = "d73be7e684e99efcd024be15a30bffcbe41b012b2f7b3c9084aed621775e6b8f"
>
> @@ -111,6 +114,9 @@ do_install_append () {
> echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >>
> ${D}${sysconfdir}/ssh/sshd_config_readonly
>
> install -d ${D}${systemd_unitdir}/system
> + if [ "${@bb.utils.filter('SSHD_DAEMON', 'service', d)}" ]; then
> + install -c -m 0644 ${WORKDIR}/sshd.service ${D}${systemd_unitdir}/system
> + fi
> install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_unitdir}/system
> install -c -m 0644 ${WORKDIR}/sshd at .service ${D}${systemd_unitdir}/system
> install -c -m 0644 ${WORKDIR}/sshdgenkeys.service
> ${D}${systemd_unitdir}/system
> --
> 2.7.4
>
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
More information about the Openembedded-core
mailing list