summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2024-08-27 19:13:37 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2024-08-27 19:15:19 -0500
commitf6f3fc6f11cd186cce30dd66b6ae7ea8fdf10116 (patch)
tree68c357a23c0fc998c98646716bc87792e6d7000c
parentec9542cba4be1b14a0a7deae54c59789140eeef2 (diff)
downloadpackages-f6f3fc6f11cd186cce30dd66b6ae7ea8fdf10116.tar.gz
packages-f6f3fc6f11cd186cce30dd66b6ae7ea8fdf10116.tar.bz2
packages-f6f3fc6f11cd186cce30dd66b6ae7ea8fdf10116.tar.xz
packages-f6f3fc6f11cd186cce30dd66b6ae7ea8fdf10116.zip
system/openssh: Add systemd unit files
-rw-r--r--system/openssh/APKBUILD34
-rw-r--r--system/openssh/sshd.service15
-rw-r--r--system/openssh/sshd.socket10
-rw-r--r--system/openssh/sshd_at.service8
4 files changed, 57 insertions, 10 deletions
diff --git a/system/openssh/APKBUILD b/system/openssh/APKBUILD
index 05c36455b..528c3ed07 100644
--- a/system/openssh/APKBUILD
+++ b/system/openssh/APKBUILD
@@ -4,7 +4,7 @@
pkgname=openssh
pkgver=9.4_p1
_myver=${pkgver%_*}${pkgver#*_}
-pkgrel=0
+pkgrel=1
pkgdesc="Remote login tool using encrypted SSH protocol"
url="https://www.openssh.com/portable.html"
arch="all"
@@ -15,14 +15,9 @@ makedepends_build="linux-pam-dev gettext-tiny"
makedepends_host="openssl-dev zlib-dev linux-headers linux-pam-dev
gettext-tiny-dev utmps-dev"
makedepends="$makedepends_build $makedepends_host"
-subpackages="$pkgname-doc
- $pkgname-keygen
- $pkgname-client
- $pkgname-keysign
- $pkgname-sftp-server:sftp
- $pkgname-server
- $pkgname-openrc
- "
+subpackages="$pkgname-doc $pkgname-keygen $pkgname-client $pkgname-keysign
+ $pkgname-sftp-server:sftp $pkgname-server $pkgname-openrc
+ $pkgname-systemd"
source="https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$_myver.tar.gz
disable-forwarding-by-default.patch
@@ -32,6 +27,10 @@ source="https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$_myver.ta
sshd.initd
sshd.confd
+
+ sshd.socket
+ sshd.service
+ sshd_at.service
"
# secfixes:
# 9.0_p1-r0:
@@ -84,6 +83,12 @@ package() {
"$pkgdir"/etc/conf.d/sshd
install -Dm644 "$builddir"/contrib/ssh-copy-id.1 \
"$pkgdir"/usr/share/man/man1/ssh-copy-id.1
+ install -D -m644 "$srcdir"/sshd.socket \
+ "$pkgdir"/lib/systemd/system/sshd.socket
+ install -D -m644 "$srcdir"/sshd.service \
+ "$pkgdir"/lib/systemd/system/sshd.service
+ install -D -m644 "$srcdir"/sshd_at.service \
+ "$pkgdir"/lib/systemd/system/sshd@.service
}
keygen() {
@@ -148,10 +153,19 @@ openrc() {
install_if="openssh-server=$pkgver-r$pkgrel openrc"
}
+systemd() {
+ default_systemd
+ depends="openssh-server"
+ install_if="openssh-server=$pkgver-r$pkgrel systemd"
+}
+
sha512sums="0aaedeced7dbc70419c7245eb0e9db4ef570e0e7739b890ebae04d56da5fe8d147e8e150f3c943f60730976569e3ac6cc8da62ec7e2a78e2ef47d295ca0b1d25 openssh-9.4p1.tar.gz
f3d5960572ddf49635d4edbdff45835df1b538a81840db169c36b39862e6fa8b0393ca90626000b758f59567ff6810b2537304098652483b3b31fb438a061de6 disable-forwarding-by-default.patch
70bffa6c061a02dd790dbaa68cd0b488395aa2312039b037e1a707e8cf7465754bf376d943d351914b64044c074af7504e845de865dec45ea00d992c2bbb8925 fix-utmpx.patch
34c0673f550e7afcd47eda4fe1da48fb42e5344c95ba8064c9c3c137fda9c43635b0f7b8145d0300f59c79f75a396ebd467afb54cdaa42aa251d624d0752dc84 sftp-interactive.patch
ad5b209f7f3fff69c10bae34da143e071e107a2141eee94f393532d6bb04a36bfe6d9b5d2c08b713f67118503c38d11b4aad689df1df7c8a918d52db8326821d time64-seccomp.patch
964c0f8538ba25bdc9cdbd1467bbdfb2090e38492ff0ef7c64473785713fe26d752ea6a7b0ee7a0b34e08f4d3b4bccf6a69e6c456f0c57d0d0c581aa8a046936 sshd.initd
-ce0abddbd2004891f88efd8522c4b37a4989290269fab339c0fa9aacc051f7fd3b20813e192e92e0e64315750041cb74012d4321260f4865ff69d7a935b259d4 sshd.confd"
+ce0abddbd2004891f88efd8522c4b37a4989290269fab339c0fa9aacc051f7fd3b20813e192e92e0e64315750041cb74012d4321260f4865ff69d7a935b259d4 sshd.confd
+4d31d373b7bdae917dc0cf05418c71d4743e98e354aefcf055f88f55c9c644a5a0e0e605dbb8372c1b98d17c0ea1c8c0fee27d38ab8dbe23c7e420a6a78c6d42 sshd.socket
+efc936ca412999e3b1acabe6cf4e87c033fe468cede1c3c499499e252cf7cdeca0841e5e1862ebe316ff3f4bf758fba674f08d081b403713e154b6bbc37da365 sshd.service
+fbfe0aed3a5e99f15dc68838975cc49a206d697fb3549d8b31db25617dc7b7b8dd2397d865d89f305d5da391cd56a69277c2215c4335fccb4dd6a9b95ba34e2f sshd_at.service"
diff --git a/system/openssh/sshd.service b/system/openssh/sshd.service
new file mode 100644
index 000000000..a541164cd
--- /dev/null
+++ b/system/openssh/sshd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=OpenSSH server daemon
+After=network.target auditd.service
+
+[Service]
+ExecStartPre=/usr/bin/ssh-keygen -A
+ExecStart=/usr/sbin/sshd -D -e
+ExecReload=/bin/kill -HUP $MAINPID
+KillMode=process
+OOMPolicy=continue
+Restart=on-failure
+RestartSec=42s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/system/openssh/sshd.socket b/system/openssh/sshd.socket
new file mode 100644
index 000000000..94b953318
--- /dev/null
+++ b/system/openssh/sshd.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=OpenSSH Server Socket
+Conflicts=sshd.service
+
+[Socket]
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/system/openssh/sshd_at.service b/system/openssh/sshd_at.service
new file mode 100644
index 000000000..e43a45799
--- /dev/null
+++ b/system/openssh/sshd_at.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=OpenSSH per-connection server daemon
+After=auditd.service
+
+[Service]
+ExecStart=-/usr/sbin/sshd -i -e
+StandardInput=socket
+StandardError=journal