]>
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 | ||
812abb17 | 17 | # |
18 | # SSHD arguments can be added here within the following | |
19 | # set of double quotes. | |
20 | # | |
21 | ||
22 | SSHD_ARGS="" | |
23 | ||
03f5c33a | 24 | case "$1" in |
306c7e1a | 25 | start) |
26 | if [ ! -f $PID_FILE ]; then | |
cf7f6b8d | 27 | if [ ! -d $localstatedir ]; then |
28 | mkdir -p $localstatedir | |
29 | fi | |
306c7e1a | 30 | echo "Starting up GSI-OpenSSH sshd server" |
812abb17 | 31 | ${sbindir}/sshd $SSHD_ARGS > /dev/null 2>&1 & |
306c7e1a | 32 | if [ $? -ne 0 ] ; then |
33 | echo "Failed to start up GSI-OpenSSH sshd server" | |
306c7e1a | 34 | fi |
35 | else | |
36 | echo "GSI-OpenSSH sshd is already running..." | |
37 | fi | |
38 | ;; | |
39 | ||
40 | stop) | |
41 | if [ -f $PID_FILE ] ; then | |
cf7f6b8d | 42 | pid=`cat $PID_FILE` |
43 | kill -TERM $pid | |
306c7e1a | 44 | sleep 2 |
cf7f6b8d | 45 | kill -TERM $pid 2> /dev/null |
306c7e1a | 46 | rm -f $PID_FILE |
47 | fi | |
48 | ;; | |
03f5c33a | 49 | |
fd95e191 | 50 | restart) |
51 | $0 stop | |
52 | $0 start | |
53 | ;; | |
54 | ||
55 | *) | |
56 | echo "Usage: $0 (start|stop|restart)" | |
306c7e1a | 57 | exit 1 |
03f5c33a | 58 | esac |
59 | ||
60 | exit 0 |