]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | # | |
3 | # atd Runs commands scheduled by the at command | |
4 | # | |
5 | # chkconfig: 345 40 60 | |
6 | # | |
7 | # description: Runs commands scheduled by the at command at the time \ | |
8 | # specified when at was run, and runs batch commands when \ | |
9 | # the load average is low enough. | |
10 | # | |
11 | # processname: atd | |
12 | ||
13 | ||
14 | # Source function library | |
15 | . /etc/rc.d/init.d/functions | |
16 | ||
17 | # Get service config | |
18 | [ -f /etc/sysconfig/atd ] && . /etc/sysconfig/atd | |
19 | ||
20 | ||
21 | # See how we were called. | |
22 | case "$1" in | |
23 | start) | |
24 | # Check if the service is already running? | |
25 | if [ ! -f /var/lock/subsys/atd ]; then | |
26 | msg_starting at | |
27 | daemon atd | |
28 | else | |
29 | msg_Already_Running atd | |
30 | exit 1 | |
31 | fi | |
32 | touch /var/lock/subsys/atd | |
33 | ;; | |
34 | stop) | |
35 | msg_stopping at | |
36 | killproc atd | |
37 | rm -f /var/lock/subsys/atd | |
38 | ;; | |
39 | reload|restart) | |
40 | $0 stop | |
41 | $0 start | |
42 | ;; | |
43 | status) | |
44 | status atd | |
45 | ;; | |
46 | *) | |
47 | msg_Usage "$0 {start|stop|restart|reload|status}" | |
48 | exit 1 | |
49 | esac | |
50 | ||
51 | exit 0 |