3 # Init file for GSI-OpenSSH server daemon
5 # chkconfig: 2345 55 25
6 # description: GSI-OpenSSH server daemon
9 GLOBUS_LOCATION="@GLOBUS_LOCATION@"
10 export GLOBUS_LOCATION
12 . ${GLOBUS_LOCATION}/libexec/globus-script-initializer
13 . ${libexecdir}/globus-sh-tools.sh
15 PID_FILE=${localstatedir}/sshd.pid
18 # SSHD arguments can be added here within the following
19 # set of double quotes.
26 if [ ! -d $localstatedir ]; then
27 mkdir -p $localstatedir
29 echo -n "Starting up GSI-OpenSSH sshd server... "
30 ${sbindir}/sshd $SSHD_ARGS > /dev/null 2>&1 &
34 echo "failed to start GSI-OpenSSH sshd server!"
40 echo -n "Stopping the GSI-OpenSSH sshd server... "
44 kill -TERM $pid 2> /dev/null
51 if [ ! -f $PID_FILE ]; then
55 psout=`ps -A | grep $pid | grep -v grep | awk "{if (\\\$1 == $pid) print}"`
56 if [ "x$psout" = "x" ]; then
57 echo "Found stale sshd pid file... removing it."
61 echo "GSI-OpenSSH sshd server is already running!"
67 if [ -f $PID_FILE ] ; then
70 echo "The server's pid file does not exist! Are you sure the server is running?"
80 echo "Usage: $0 (start|stop|restart)"