3 # Init file for GSI-OpenSSH server daemon
5 # chkconfig: 2345 55 25
6 # description: GSI-OpenSSH server daemon
11 # Required-Start: $network
12 # Required-Stop: $network
13 # Default-Start: 2 3 4 5
15 # Description: Start the sshd daemon
18 GLOBUS_LOCATION="@GLOBUS_LOCATION@"
19 export GLOBUS_LOCATION
21 . ${GLOBUS_LOCATION}/libexec/globus-script-initializer
22 . ${libexecdir}/globus-sh-tools.sh
24 PID_FILE=${localstatedir}/sshd.pid
28 # SSHD arguments can be added here within the following
29 # set of double quotes.
36 if [ ! -d $localstatedir ]; then
37 mkdir -p $localstatedir
39 printf "%s" "Starting up GSI-OpenSSH sshd server... "
40 if [ ! -e $SSHD ]; then
42 echo "$SSHD does not exist."
45 if [ ! -x $SSHD ]; then
47 echo "$SSHD is not executable."
50 $SSHD $SSHD_ARGS > /dev/null 2>&1
54 echo "failed to start $SSHD!"
60 printf "%s" "Stopping the GSI-OpenSSH sshd server... "
64 kill -TERM $pid 2> /dev/null
71 if [ ! -f $PID_FILE ]; then
75 psout=`ps -A | grep $pid | grep -v grep | awk "{if (\\\$1 == $pid) print}"`
76 if [ "x$psout" = "x" ]; then
77 echo "Found stale sshd pid file... removing it."
81 echo "GSI-OpenSSH sshd server is already running!"
87 if [ -f $PID_FILE ] ; then
90 echo "The server's pid file does not exist! Are you sure the server is running?"
100 echo "Usage: $0 (start|stop|restart)"