2 # Copyright (c) 1995-1998 SuSE GmbH Nuernberg, Germany.
4 # Author: Chris Saia <csaia@wtower.com>
8 # and symbolic its link
15 # Determine the base and follow a runlevel link name.
17 link=${base#*[SK][0-9][0-9]}
19 # Force execution if not called by a runlevel directory.
20 test $link = $base && START_SSHD=yes
21 test "$START_SSHD" = yes || exit 0
23 # The echo return value for success (defined in /etc/rc.config).
27 echo -n "Starting service sshd"
28 ## Start daemon with startproc(8). If this fails
29 ## the echo return value is set appropriate.
31 startproc /usr/sbin/sshd || return=$rc_failed
36 echo -n "Stopping service sshd"
37 ## Stop daemon with killproc(8) and if this fails
38 ## set echo the echo return value.
40 killproc -TERM /usr/sbin/sshd || return=$rc_failed
45 ## If first returns OK call the second, if first or
46 ## second command fails, set echo return value.
47 $0 stop && $0 start || return=$rc_failed
50 ## Choose ONE of the following two cases:
52 ## First possibility: A few services accepts a signal
53 ## to reread the (changed) configuration.
55 echo -n "Reload service sshd"
56 killproc -HUP /usr/sbin/sshd || return=$rc_failed
60 echo -n "Checking for service sshd"
61 ## Check status with checkproc(8), if process is running
62 ## checkproc will return with exit status 0.
64 checkproc /usr/sbin/sshd && echo OK || echo No process
67 ## Optional: Probe for the necessity of a reload,
68 ## give out the argument which is required for a reload.
70 test /etc/ssh/sshd_config -nt /var/run/sshd.pid && echo reload
73 echo "Usage: $0 {start|stop|status|restart|reload[|probe]}"
78 # Inform the caller not only verbosely and set an exit status.
79 test "$return" = "$rc_done" || exit 1