Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=b0390ba1cc74ef8420e765bb35cb704a062a53d4
commit b0390ba1cc74ef8420e765bb35cb704a062a53d4 Author: Miklos Vajna <[email protected]> Date: Mon Sep 19 00:52:49 2011 +0200 openssh-5.9p1-2-i686 - add native systemd units diff --git a/source/network/openssh/FrugalBuild b/source/network/openssh/FrugalBuild index 70c6f27..c9cf9ab 100644 --- a/source/network/openssh/FrugalBuild +++ b/source/network/openssh/FrugalBuild @@ -4,7 +4,7 @@ pkgname=openssh pkgver=5.9p1 -pkgrel=1 +pkgrel=2 pkgdesc='Secure Shell daemon and clients' url="http://www.openssh.com/" backup=('etc/ssh/ssh_config' 'etc/ssh/sshd_config') @@ -16,8 +16,9 @@ archs=('i686' 'x86_64' 'ppc' 'arm') up2date="lynx -dump http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/|Flasttar" source=(http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$pkgver.tar.gz \ README.Frugalware \ - rc.sshd rc.sshd-{hu,de}.po) -signatures=("$source.asc" '' '' '' '') + rc.sshd rc.sshd-{hu,de}.po \ + sshd-keygen sshd-keygen.service sshd.service) +signatures=("$source.asc" '' '' '' '' '' '' '') replaces=('openldev') subpkgs=('openssh-askpass') @@ -43,6 +44,9 @@ build() echo "You need this file so pacman-g2 will not remove /var/empty accidentally." > $Fdestdir/var/empty/.openssh || Fdie Frm /etc/ssh/ssh_host_{dsa_key,dsa_key.pub,rsa_key,rsa_key.pub,key,key.pub} Frcd2 sshd + Fexe /usr/sbin/sshd-keygen + Ffile /lib/systemd/system/sshd-keygen.service + Ffile /lib/systemd/system/sshd.service Fsed '^#PermitRootLogin yes$' 'PermitRootLogin no' $Fdestdir/etc/ssh/sshd_config Fsed '^#X11Forwarding no$' 'X11Forwarding yes' $Fdestdir/etc/ssh/sshd_config Fsed '# ForwardX11 no' ' ForwardX11Trusted yes' $Fdestdir/etc/ssh/ssh_config diff --git a/source/network/openssh/openssh.install b/source/network/openssh/openssh.install index 5b57490..e78a7de 100644 --- a/source/network/openssh/openssh.install +++ b/source/network/openssh/openssh.install @@ -1,22 +1,29 @@ -# arg 1: the new package version post_install() { - chkconfig --add rc.sshd + chkconfig --add rc.sshd + systemctl enable sshd.service >/dev/null 2>&1 + systemctl enable sshd-keygen.service >/dev/null 2>&1 } -# arg 1: the new package version -# arg 2: the old package version post_upgrade() { - /bin/true + systemctl daemon-reload >/dev/null 2>&1 + # this can be removed after Frugalware-1.6 + if [ `vercmp $2 5.9p1-2` -lt 0 ] ; then + if chkconfig rc.sshd; then + post_install + fi + fi } -# arg 1: the old package version pre_remove() { - chkconfig --del rc.sshd + chkconfig --del rc.sshd + systemctl --no-reload disable sshd.service >/dev/null 2>&1 + systemctl --no-reload disable sshd-keygen.service >/dev/null 2>&1 + systemctl stop sshd.service >/dev/null 2>&1 + systemctl stop sshd-keygen.service > /dev/null 2>&1 } -# arg 1: the old package version post_remove() { - /bin/true + systemctl daemon-reload >/dev/null 2>&1 } op=$1 diff --git a/source/network/openssh/sshd-keygen b/source/network/openssh/sshd-keygen new file mode 100644 index 0000000..e773885 --- /dev/null +++ b/source/network/openssh/sshd-keygen @@ -0,0 +1,11 @@ +#!/bin/bash + +if [ ! -r /etc/ssh/ssh_host_key ]; then + /usr/bin/ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N '' |logger +fi +if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then + /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N '' |logger +fi +if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then + /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' |logger +fi diff --git a/source/network/openssh/sshd-keygen.service b/source/network/openssh/sshd-keygen.service new file mode 100644 index 0000000..20e4aeb --- /dev/null +++ b/source/network/openssh/sshd-keygen.service @@ -0,0 +1,11 @@ +[Unit] +Description=SSH server keys generation. +Before=sshd.service + +[Service] +Type=oneshot +ExecStart=/usr/sbin/sshd-keygen +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/source/network/openssh/sshd.service b/source/network/openssh/sshd.service new file mode 100644 index 0000000..d379c31 --- /dev/null +++ b/source/network/openssh/sshd.service @@ -0,0 +1,10 @@ +[Unit] +Description=OpenSSH server daemon. +After=network.target + +[Service] +ExecStart=/usr/sbin/sshd -D +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
