#! /bin/sh
set -e
+PIDFILE=/var/run/sshd.pid
+
# source function library
. /etc/init.d/functions
echo "Starting OpenBSD Secure Shell server: sshd"
check_keys
check_privsep_dir
- start-stop-daemon -S -x /usr/sbin/sshd -- $SSHD_OPTS
+ start-stop-daemon -S -p $PIDFILE -x /usr/sbin/sshd -- $SSHD_OPTS
echo "done."
;;
stop)
echo -n "Stopping OpenBSD Secure Shell server: sshd"
- start-stop-daemon -K -x /usr/sbin/sshd
+ start-stop-daemon -K -p $PIDFILE -x /usr/sbin/sshd
echo "."
;;
check_keys
check_config
echo -n "Reloading OpenBSD Secure Shell server's configuration"
- start-stop-daemon -K -s 1 -x /usr/sbin/sshd
+ start-stop-daemon -K -p $PIDFILE -s 1 -x /usr/sbin/sshd
echo "."
;;
check_keys
check_config
echo -n "Restarting OpenBSD Secure Shell server: sshd"
- start-stop-daemon -K --oknodo -x /usr/sbin/sshd
+ start-stop-daemon -K -p $PIDFILE --oknodo -x /usr/sbin/sshd
check_for_no_start
check_privsep_dir
sleep 2
- start-stop-daemon -S -x /usr/sbin/sshd -- $SSHD_OPTS
+ start-stop-daemon -S -p $PIDFILE -x /usr/sbin/sshd -- $SSHD_OPTS
echo "."
;;