]> andersk Git - gssapi-openssh.git/commitdiff
- use POSIX printf instead of non-POSIX echo -n
authorbasney <basney>
Wed, 25 Feb 2009 19:11:17 +0000 (19:11 +0000)
committerbasney <basney>
Wed, 25 Feb 2009 19:11:17 +0000 (19:11 +0000)
- check that $GLOBUS_LOCATION/sbin/sshd exists and is executable
- let the sshd background itself, so we see startup errors

setup/SXXsshd.in

index c015f23e7f4c5cdcaf3298cc0d084b5396c83958..03d6c07bb1c9de0df5f3a5e9c27ac8d230ee775e 100644 (file)
@@ -22,6 +22,7 @@ export GLOBUS_LOCATION
 . ${libexecdir}/globus-sh-tools.sh
 
 PID_FILE=${localstatedir}/sshd.pid
+SSHD=${sbindir}/sshd
 
 #
 # SSHD arguments can be added here within the following
@@ -35,18 +36,28 @@ do_start()
     if [ ! -d $localstatedir ]; then
         mkdir -p $localstatedir
     fi
-    echo -n "Starting up GSI-OpenSSH sshd server... "
-    ${sbindir}/sshd $SSHD_ARGS > /dev/null 2>&1 &
+    printf "%s" "Starting up GSI-OpenSSH sshd server... "
+    if [ ! -e $SSHD ]; then
+        echo "failed"
+        echo "$SSHD does not exist."
+        exit 1;
+    fi
+    if [ ! -x $SSHD ]; then
+        echo "failed"
+        echo "$SSHD is not executable."
+        exit 1;
+    fi
+    $SSHD $SSHD_ARGS > /dev/null 2>&1
     if [ $? -eq 0 ]; then
         echo "done."
     else
-        echo "failed to start GSI-OpenSSH sshd server!"
+        echo "failed to start $SSHD!"
     fi
 }
 
 do_stop()
 {
-    echo -n "Stopping the GSI-OpenSSH sshd server... "
+    printf "%s" "Stopping the GSI-OpenSSH sshd server... "
     pid=`cat $PID_FILE`
     kill -TERM $pid
     sleep 2
This page took 0.052153 seconds and 5 git commands to generate.