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
27 # SSHD arguments can be added here within the following
28 # set of double quotes.
35 if [ ! -d $localstatedir ]; then
36 mkdir -p $localstatedir
38 echo -n "Starting up GSI-OpenSSH sshd server... "
39 ${sbindir}/sshd $SSHD_ARGS > /dev/null 2>&1 &
43 echo "failed to start GSI-OpenSSH sshd server!"
49 echo -n "Stopping the GSI-OpenSSH sshd server... "
53 kill -TERM $pid 2> /dev/null
60 if [ ! -f $PID_FILE ]; then
64 psout=`ps -A | grep $pid | grep -v grep | awk "{if (\\\$1 == $pid) print}"`
65 if [ "x$psout" = "x" ]; then
66 echo "Found stale sshd pid file... removing it."
70 echo "GSI-OpenSSH sshd server is already running!"
76 if [ -f $PID_FILE ] ; then
79 echo "The server's pid file does not exist! Are you sure the server is running?"
89 echo "Usage: $0 (start|stop|restart)"