dropbear-systemd: config files for socket-based activation of dropbear

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
This commit is contained in:
Koen Kooi
2011-06-18 16:14:51 +02:00
parent 790355db87
commit c5d9f70552
4 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
[Unit]
Conflicts=dropbear.service
[Socket]
ListenStream=22
Accept=yes
[Install]
WantedBy=sockets.target
Also=dropbearkey.service

View File

@@ -0,0 +1,9 @@
[Unit]
Description=SSH Per-Connection Server
Requires=dropbearkey.service
After=syslog.target dropbearkey.service
[Service]
ExecStart=-/usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -p 22
ExecReload=/bin/kill -HUP $MAINPID
StandardInput=socket

View File

@@ -0,0 +1,10 @@
[Unit]
Description=SSH Key Generation
ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key
[Service]
ExecStart=/usr/sbin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,40 @@
DESCRIPTION = "Socket based activation for dropbear ssh server"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
inherit allarch
SRC_URI = "file://dropbearkey.service \
file://dropbear@.service \
file://dropbear.socket \
"
do_configure() {
:
}
do_compile() {
:
}
do_install() {
install -d ${D}${base_libdir}/systemd/system
install -m 0644 ${WORKDIR}/dropbear*.* ${D}${base_libdir}/systemd/system/
}
pkg_postinst_${PN} () {
if test "x$D" != "x"; then
exit 1
fi
systemctl enable dropbear.socket
ln -sf /dev/null ${base_libdir}/systemd/system/dropbear.service
}
pkg_postrm_${PN} () {
systemctl disable dropbear.socket
rm -f ${base_libdir}/systemd/system/dropbear.service
}
RDEPENDS_${PN} = "systemd dropbear"
FILES_${PN} = "${base_libdir}/systemd/system"