diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2011-06-18 16:14:51 +0200 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2011-06-19 20:41:26 +0200 |
commit | c5d9f7055288a56ebe68c3ab022f40c8932b215f (patch) | |
tree | ba83b3251fe7f0d9dd8870b58c5c9da094d1a645 /meta-oe | |
parent | 790355db870872419a19f12bfdd0df0d52f8ae7b (diff) | |
download | meta-openembedded-c5d9f7055288a56ebe68c3ab022f40c8932b215f.tar.gz |
dropbear-systemd: config files for socket-based activation of dropbear
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe')
4 files changed, 69 insertions, 0 deletions
diff --git a/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear.socket b/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear.socket new file mode 100644 index 000000000..e5c61b755 --- /dev/null +++ b/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear.socket | |||
@@ -0,0 +1,10 @@ | |||
1 | [Unit] | ||
2 | Conflicts=dropbear.service | ||
3 | |||
4 | [Socket] | ||
5 | ListenStream=22 | ||
6 | Accept=yes | ||
7 | |||
8 | [Install] | ||
9 | WantedBy=sockets.target | ||
10 | Also=dropbearkey.service | ||
diff --git a/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear@.service b/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear@.service new file mode 100644 index 000000000..4fba3f05c --- /dev/null +++ b/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbear@.service | |||
@@ -0,0 +1,9 @@ | |||
1 | [Unit] | ||
2 | Description=SSH Per-Connection Server | ||
3 | Requires=dropbearkey.service | ||
4 | After=syslog.target dropbearkey.service | ||
5 | |||
6 | [Service] | ||
7 | ExecStart=-/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -p 22 | ||
8 | ExecReload=/bin/kill -HUP $MAINPID | ||
9 | StandardInput=socket | ||
diff --git a/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbearkey.service b/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbearkey.service new file mode 100644 index 000000000..7f03000eb --- /dev/null +++ b/meta-oe/recipes-core/dropbear/dropbear-systemd/dropbearkey.service | |||
@@ -0,0 +1,10 @@ | |||
1 | [Unit] | ||
2 | Description=SSH Key Generation | ||
3 | ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key | ||
4 | |||
5 | [Service] | ||
6 | ExecStart=/usr/sbin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key | ||
7 | RemainAfterExit=yes | ||
8 | |||
9 | [Install] | ||
10 | WantedBy=multi-user.target | ||
diff --git a/meta-oe/recipes-core/dropbear/dropbear-systemd_v1.bb b/meta-oe/recipes-core/dropbear/dropbear-systemd_v1.bb new file mode 100644 index 000000000..b46c0e2a4 --- /dev/null +++ b/meta-oe/recipes-core/dropbear/dropbear-systemd_v1.bb | |||
@@ -0,0 +1,40 @@ | |||
1 | DESCRIPTION = "Socket based activation for dropbear ssh server" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" | ||
4 | |||
5 | inherit allarch | ||
6 | |||
7 | SRC_URI = "file://dropbearkey.service \ | ||
8 | file://dropbear@.service \ | ||
9 | file://dropbear.socket \ | ||
10 | " | ||
11 | |||
12 | do_configure() { | ||
13 | : | ||
14 | } | ||
15 | |||
16 | do_compile() { | ||
17 | : | ||
18 | } | ||
19 | |||
20 | do_install() { | ||
21 | install -d ${D}${base_libdir}/systemd/system | ||
22 | install -m 0644 ${WORKDIR}/dropbear*.* ${D}${base_libdir}/systemd/system/ | ||
23 | } | ||
24 | |||
25 | pkg_postinst_${PN} () { | ||
26 | if test "x$D" != "x"; then | ||
27 | exit 1 | ||
28 | fi | ||
29 | systemctl enable dropbear.socket | ||
30 | ln -sf /dev/null ${base_libdir}/systemd/system/dropbear.service | ||
31 | } | ||
32 | |||
33 | pkg_postrm_${PN} () { | ||
34 | systemctl disable dropbear.socket | ||
35 | rm -f ${base_libdir}/systemd/system/dropbear.service | ||
36 | } | ||
37 | |||
38 | RDEPENDS_${PN} = "systemd dropbear" | ||
39 | FILES_${PN} = "${base_libdir}/systemd/system" | ||
40 | |||