openssh: enable systemd socket activation for sshd by default.

This commit is contained in:
Juan RP 2012-06-02 13:31:20 +02:00
parent c71f5b085f
commit 3c45cf4606
6 changed files with 46 additions and 17 deletions

View file

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

View file

@ -0,0 +1,8 @@
[Unit]
Description=OpenSSH Per-Connection Daemon
After=sshdgenkeys.service
[Service]
ExecStart=-/usr/sbin/sshd -i
StandardInput=socket
StandardError=syslog

View file

@ -1,14 +1,12 @@
# Template file for 'openssh-client'.
#
depends="openssh>=6.0p1"
conf_files="/etc/ssh/ssh_config"
depends="openssh>=$version"
short_desc="The OpenSSH client"
long_desc="${long_desc}
This package contains the ${pkgname} client files."
conf_files="/etc/ssh/ssh_config"
do_install() {
for f in scp sftp slogin ssh ssh-add ssh-agent \
ssh-copy-id ssh-keyscan findssl; do

View file

@ -0,0 +1,15 @@
case $ACTION in
post)
cat <<_EOF
===========================================================================
Two systemd services are provided by ${PKGNAME}-${VERSION}:
- sshd.service (starts a single instance of sshd)
- sshd.socket (per-connection on demand sshd)
By default we enable the on-demand per-connection daemon, which is lighter
when there are few connections.
===========================================================================
_EOF
;;
esac

View file

@ -1,15 +1,13 @@
# Template file for 'openssh-server'.
#
depends="openssh>=6.0p1"
conf_files="/etc/ssh/sshd_config /etc/pam.d/sshd"
systemd_services="sshd.socket on"
depends="openssh>=$version"
short_desc="The OpenSSH server"
long_desc="${long_desc}
This package contains the ${pkgname} server files."
conf_files="/etc/ssh/sshd_config /etc/pam.d/sshd"
systemd_services="sshd.service on sshdgenkeys.service on"
do_install() {
vmove usr/libexec/sftp-server usr/libexec
vmove etc/ssh/sshd_config etc/ssh
@ -19,7 +17,9 @@ do_install() {
vmove usr/share/man/man8/${f}.8 usr/share/man/man8
done
vmove etc/pam.d etc
vinstall ${FILESDIR}/sshd.service 644 lib/systemd/system
vinstall ${FILESDIR}/sshdgenkeys.service 644 lib/systemd/system
vinstall ${FILESDIR}/sshd.tmpfiles.d 644 usr/lib/tmpfiles.d sshd.conf
vmkdir lib/systemd/system
install -m644 ${FILESDIR}/*.{socket,service} \
${DESTDIR}/lib/systemd/system
vinstall ${FILESDIR}/sshd.tmpfiles.d 644 \
usr/lib/tmpfiles.d sshd.conf
}

View file

@ -1,6 +1,7 @@
# Template file for 'openssh'
pkgname=openssh
version=6.0p1
revision=1
distfiles="ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$version.tar.gz"
build_style=gnu-configure
configure_args="--without-tcp-wrappers --datadir=/usr/share/openssh
@ -10,6 +11,8 @@ configure_args="--without-tcp-wrappers --datadir=/usr/share/openssh
--with-kerberos5=/usr"
depends="shadow"
makedepends="perl>=0 zlib-devel openssl-devel pam-devel mit-krb5-devel e2fsprogs-devel"
conf_files="/etc/ssh/moduli"
subpackages="$pkgname-client $pkgname-server"
short_desc="The OpenSSH implementation of SSH protocol versions 1 and 2"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://www.openssh.org"
@ -30,11 +33,6 @@ long_desc="
client and server. To make this package useful, you should also
install openssh-client, openssh-server, or both."
conf_files="/etc/ssh/moduli"
subpackages="$pkgname-client $pkgname-server"
post_install() {
vinstall contrib/sshd.pam.generic 644 etc/pam.d sshd
vinstall contrib/findssl.sh 755 usr/bin findssl