Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
136 - 1
#!/bin/sh
2
#
3
# APPNAME - <summary>
4
#
5
# chkconfig:   <default runlevel(s)> <start> <stop>
6
# description: <description, split multiple lines with \
7
#              a backslash>
8
 
9
# http://fedoraproject.org/wiki/FCNewInit/Initscripts
10
### BEGIN INIT INFO
11
# Provides:
12
# Required-Start:
13
# Required-Stop:
14
# Should-Start:
15
# Should-Stop:
16
# Default-Start:
17
# Default-Stop:
18
# Short-Description:
19
# Description:
20
### END INIT INFO
21
 
22
# Source function library.
23
. /etc/rc.d/init.d/functions
24
 
25
exec="/usr/sbin/APPNAME"
26
prog=$(basename $exec)
27
 
28
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
29
 
30
lockfile=/var/lock/subsys/$prog
31
 
32
start() {
33
    echo -n $"Starting $prog: "
34
    # if not running, start it up here, usually something like "daemon $exec"
35
    retval=$?
36
    echo
37
    [ $retval -eq 0 ] && touch $lockfile
38
    return $retval
39
}
40
 
41
stop() {
42
    echo -n $"Stopping $prog: "
43
    # stop it here, often "killproc $prog"
44
    retval=$?
45
    echo
46
    [ $retval -eq 0 ] && rm -f $lockfile
47
    return $retval
48
}
49
 
50
restart() {
51
    stop
52
    start
53
}
54
 
55
case "$1" in
56
    start|stop|restart)
57
        $1
58
        ;;
59
    force-reload)
60
        restart
61
        ;;
62
    status)
63
        status $prog
64
        ;;
65
    try-restart|condrestart)
66
        if status $prog >/dev/null ; then
67
            restart
68
        fi
69
	;;
70
    reload)
71
        # If config can be reloaded without restarting, implement it here,
72
        # remove the "exit", and add "reload" to the usage message below.
73
        # For example:
74
        # status $prog >/dev/null || exit 7
75
        # killproc $prog -HUP
76
        action $"Service ${0##*/} does not support the reload action: " /bin/false
77
        exit 3
78
        ;;
79
    *)
80
        echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
81
        exit 2
82
esac