]> andersk Git - gssapi-openssh.git/blob - setup/SXXsshd.in
o Add chkconfig comments to the sshd startup script.
[gssapi-openssh.git] / setup / SXXsshd.in
1 #!/bin/sh
2 #
3 # Init file for OpenSSH server daemon
4 #
5 # chkconfig: 2345 55 25
6 # description: OpenSSH server daemon
7 #
8
9 GLOBUS_LOCATION="@GLOBUS_LOCATION@"
10 export GLOBUS_LOCATION
11
12 . ${GLOBUS_LOCATION}/libexec/globus-script-initializer
13 . ${libexecdir}/globus-sh-tools.sh
14
15 PID_FILE=${localstatedir}/sshd.pid
16
17 case "$1" in
18     start)
19         if [ ! -f $PID_FILE ]; then
20             if [ ! -d $localstatedir ]; then
21                 mkdir -p $localstatedir
22             fi
23             echo "Starting up GSI-OpenSSH sshd server"
24             ${sbindir}/sshd > /dev/null 2>&1 &
25             if [ $? -ne 0 ] ; then
26                 echo "Failed to start up GSI-OpenSSH sshd server"
27             fi
28         else
29             echo "GSI-OpenSSH sshd is already running..."
30         fi
31         ;;
32
33     stop)
34         if [ -f $PID_FILE ] ; then
35             pid=`cat $PID_FILE`
36             kill -TERM $pid
37             sleep 2
38             kill -TERM $pid 2> /dev/null
39             rm -f $PID_FILE
40         fi
41         ;;
42
43   *)
44         echo "Usage: $0 ( start | stop )"
45         exit 1
46 esac
47
48 exit 0
This page took 0.199205 seconds and 5 git commands to generate.