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 "Starting up GSI-OpenSSH sshd server..."
30 ${sbindir}/sshd $SSHD_ARGS > /dev/null 2>&1 &
31 if [ $? -ne 0 ] ; then
32 echo "Failed to start up GSI-OpenSSH sshd server!"
38 echo "Stopping the GSI-OpenSSH sshd server..."
42 kill -TERM $pid 2> /dev/null
48 if [ ! -f $PID_FILE ]; then
52 psout=`ps -A | grep $pid | grep -v grep | awk "{if (\\\$1 == $pid) print}"`
53 if [ "x$psout" = "x" ]; then
54 echo "Found stale sshd pid file. Removing."
58 echo "GSI-OpenSSH sshd is already running!"
64 if [ -f $PID_FILE ] ; then
75 echo "Usage: $0 (start|stop|restart)"