]>
Commit | Line | Data |
---|---|---|
03f5c33a | 1 | #!/bin/sh |
4bb7c5ae | 2 | # |
e0ceafd7 | 3 | # Init file for GSI-OpenSSH server daemon |
4bb7c5ae | 4 | # |
5 | # chkconfig: 2345 55 25 | |
e0ceafd7 | 6 | # description: GSI-OpenSSH server daemon |
4bb7c5ae | 7 | # |
03f5c33a | 8 | |
20bb6dc8 | 9 | GLOBUS_LOCATION="@GLOBUS_LOCATION@" |
03f5c33a | 10 | export GLOBUS_LOCATION |
11 | ||
12 | . ${GLOBUS_LOCATION}/libexec/globus-script-initializer | |
13 | . ${libexecdir}/globus-sh-tools.sh | |
03f5c33a | 14 | |
15 | PID_FILE=${localstatedir}/sshd.pid | |
16 | ||
17 | case "$1" in | |
306c7e1a | 18 | start) |
19 | if [ ! -f $PID_FILE ]; then | |
cf7f6b8d | 20 | if [ ! -d $localstatedir ]; then |
21 | mkdir -p $localstatedir | |
22 | fi | |
306c7e1a | 23 | echo "Starting up GSI-OpenSSH sshd server" |
51836dc1 | 24 | ${sbindir}/sshd > /dev/null 2>&1 & |
306c7e1a | 25 | if [ $? -ne 0 ] ; then |
26 | echo "Failed to start up GSI-OpenSSH sshd server" | |
306c7e1a | 27 | fi |
28 | else | |
29 | echo "GSI-OpenSSH sshd is already running..." | |
30 | fi | |
31 | ;; | |
32 | ||
33 | stop) | |
34 | if [ -f $PID_FILE ] ; then | |
cf7f6b8d | 35 | pid=`cat $PID_FILE` |
36 | kill -TERM $pid | |
306c7e1a | 37 | sleep 2 |
cf7f6b8d | 38 | kill -TERM $pid 2> /dev/null |
306c7e1a | 39 | rm -f $PID_FILE |
40 | fi | |
41 | ;; | |
03f5c33a | 42 | |
fd95e191 | 43 | restart) |
44 | $0 stop | |
45 | $0 start | |
46 | ;; | |
47 | ||
48 | *) | |
49 | echo "Usage: $0 (start|stop|restart)" | |
306c7e1a | 50 | exit 1 |
03f5c33a | 51 | esac |
52 | ||
53 | exit 0 |