]> andersk Git - gssapi-openssh.git/blob - setup/SXXsshd.in
o Initialize privilege separation setting at the beginning of the script
[gssapi-openssh.git] / setup / SXXsshd.in
1 #!/bin/sh
2 #
3 # Init file for GSI-OpenSSH server daemon
4 #
5 # chkconfig: 2345 55 25
6 # description: GSI-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 #
18 # SSHD arguments can be added here within the following
19 # set of double quotes.
20 #
21
22 SSHD_ARGS=""
23
24 case "$1" in
25     start)
26         if [ ! -f $PID_FILE ]; then
27             if [ ! -d $localstatedir ]; then
28                 mkdir -p $localstatedir
29             fi
30             echo "Starting up GSI-OpenSSH sshd server"
31             ${sbindir}/sshd $SSHD_ARGS > /dev/null 2>&1 &
32             if [ $? -ne 0 ] ; then
33                 echo "Failed to start up GSI-OpenSSH sshd server"
34             fi
35         else
36             echo "GSI-OpenSSH sshd is already running..."
37         fi
38         ;;
39
40     stop)
41         if [ -f $PID_FILE ] ; then
42             pid=`cat $PID_FILE`
43             kill -TERM $pid
44             sleep 2
45             kill -TERM $pid 2> /dev/null
46             rm -f $PID_FILE
47         fi
48         ;;
49
50     restart)
51         $0 stop
52         $0 start
53         ;;
54
55     *)
56         echo "Usage: $0 (start|stop|restart)"
57         exit 1
58 esac
59
60 exit 0
This page took 0.048541 seconds and 5 git commands to generate.