Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/sh
2
#
3
# atd Starts/stop the "at" daemon
4
#
5
# chkconfig:   345 95 5
6
# description: Runs commands scheduled by the "at" command at the time \
7
#    specified when "at" was run, and runs batch commands when the load \
8
#    average is low enough.
9
 
10
### BEGIN INIT INFO
11
# Provides: atd at batch
12
# Required-Start: $local_fs
13
# Required-Stop: $local_fs
14
# Default-Start: 345
15
# Default-Stop: 95
16
# Short-Description: Starts/stop the "at" daemon
17
# Description:      Runs commands scheduled by the "at" command at the time
18
#    specified when "at" was run, and runs batch commands when the load
19
#    average is low enough.
20
### END INIT INFO
21
 
22
# Source function library.
23
. /etc/rc.d/init.d/functions
24
 
25
exec=/usr/sbin/atd
26
prog="atd"
27
config=/etc/sysconfig/atd
28
 
29
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
30
 
31
lockfile=/var/lock/subsys/$prog
32
 
33
start() {
34
    [ -x $exec ] || exit 5
35
    [ -f $config ] || exit 6
36
    echo -n $"Starting $prog: "
37
    daemon $exec $OPTS
38
    retval=$?
39
    echo
40
    [ $retval -eq 0 ] && touch $lockfile
41
}
42
 
43
stop() {
44
    echo -n $"Stopping $prog: "
45
    if [ -n "`pidfileofproc $exec`" ] ; then
46
        killproc $exec
47
		RETVAL=3
48
    else
49
        failure $"Stopping $prog"
50
    fi
51
    retval=$?
52
    echo
53
    [ $retval -eq 0 ] && rm -f $lockfile
54
}
55
 
56
restart() {
57
    stop
58
    start
59
}
60
 
61
reload() {
62
    restart
63
}
64
 
65
force_reload() {
66
    restart
67
}
68
 
69
rh_status() {
70
    # run checks to determine if the service is running or use generic status
71
    status $prog
72
}
73
 
74
rh_status_q() {
75
    rh_status >/dev/null 2>&1
76
}
77
 
78
 
79
case "$1" in
80
    start)
81
        rh_status_q && exit 0
82
        $1
83
        ;;
84
    stop)
85
        rh_status_q || exit 0
86
        $1
87
        ;;
88
    restart)
89
        $1
90
        ;;
91
    reload)
92
        rh_status_q || exit 7
93
        $1
94
        ;;
95
    force-reload)
96
        force_reload
97
        ;;
98
    status)
99
        rh_status
100
        ;;
101
    condrestart|try-restart)
102
        rh_status_q || exit 0
103
        restart
104
        ;;
105
    *)
106
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
107
        exit 2
108
esac
109
exit $?