openssh-server: switch to systemd, drop openrc support.
This commit is contained in:
parent
f759efbb1f
commit
22323bb002
5 changed files with 53 additions and 3 deletions
15
srcpkgs/openssh/files/sshd.service
Normal file
15
srcpkgs/openssh/files/sshd.service
Normal file
|
@ -0,0 +1,15 @@
|
|||
[Unit]
|
||||
Description=SSH Secure Shell Service
|
||||
After=syslog.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/sshd -D
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
# Note that this is the service file for running a single SSH server for all
|
||||
# incoming connections, suitable only for systems with a large amount of SSH
|
||||
# traffic. In almost all other cases it is a better idea to use sshd.socket +
|
||||
# sshd@.service (i.e. the on-demand spawning version for one instance per
|
||||
# connection).
|
1
srcpkgs/openssh/files/sshd.tmpfiles.d
Normal file
1
srcpkgs/openssh/files/sshd.tmpfiles.d
Normal file
|
@ -0,0 +1 @@
|
|||
d /var/chroot/ssh 755 root root
|
16
srcpkgs/openssh/files/sshdgenkeys.scripts
Normal file
16
srcpkgs/openssh/files/sshdgenkeys.scripts
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ ! -e /etc/ssh/ssh_host_key ]; then
|
||||
/usr/bin/ssh-keygen -t rsa1 -b 4096 -f /etc/ssh/ssh_host_key -N ''
|
||||
fi
|
||||
if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
|
||||
/usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N ''
|
||||
fi
|
||||
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
|
||||
/usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
|
||||
fi
|
||||
if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]; then
|
||||
/usr/bin/ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
|
||||
fi
|
||||
|
||||
exit 0
|
13
srcpkgs/openssh/files/sshdgenkeys.service
Normal file
13
srcpkgs/openssh/files/sshdgenkeys.service
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=OpenSSH server Key Generation
|
||||
ConditionPathExists=|!/etc/ssh/ssh_host_key
|
||||
ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
|
||||
ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key
|
||||
ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key
|
||||
|
||||
[Service]
|
||||
ExecStart=/lib/systemd/scripts/sshdgenkeys
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -5,8 +5,10 @@ long_desc="${long_desc}
|
|||
|
||||
This package contains the ${pkgname} server files."
|
||||
|
||||
revision=1
|
||||
|
||||
conf_files="/etc/ssh/sshd_config /etc/pam.d/sshd"
|
||||
openrc_services="sshd default true"
|
||||
systemd_services="sshd.service sshdgenkeys.service"
|
||||
|
||||
Add_dependency run glibc
|
||||
Add_dependency run zlib
|
||||
|
@ -27,6 +29,9 @@ do_install()
|
|||
vmove usr/share/man/man8/${f}.8 usr/share/man/man8
|
||||
done
|
||||
vmove etc/pam.d etc
|
||||
vmove etc/init.d etc
|
||||
vmkdir var/chroot/ssh
|
||||
vinstall ${FILESDIR}/sshd.service 644 lib/systemd/system
|
||||
vinstall ${FILESDIR}/sshdgenkeys.service 644 lib/systemd/system
|
||||
vinstall ${FILESDIR}/sshdgenkeys.scripts 755 \
|
||||
lib/systemd/scripts sshdgenkeys
|
||||
vinstall ${FILESDIR}/sshd.tmpfiles.d 644 usr/lib/tmpfiles.d sshd.conf
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue