]>
Commit | Line | Data |
---|---|---|
f4736427 | 1 | #!/bin/sh |
283c91e0 | 2 | # |
834145e0 | 3 | # atd Runs commands scheduled by the at command |
283c91e0 | 4 | # |
834145e0 | 5 | # chkconfig: 345 40 60 |
283c91e0 | 6 | # |
834145e0 | 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 | ||
283c91e0 | 13 | |
834145e0 | 14 | # Source function library |
283c91e0 | 15 | . /etc/rc.d/init.d/functions |
16 | ||
834145e0 | 17 | # Get service config |
18 | [ -f /etc/sysconfig/atd ] && . /etc/sysconfig/atd | |
5d26daad | 19 | |
834145e0 | 20 | |
21 | # See how we were called. | |
283c91e0 | 22 | case "$1" in |
23 | start) | |
834145e0 | 24 | # Check if the service is already running? |
25 | if [ ! -f /var/lock/subsys/atd ]; then | |
26 | show Starting at daemon | |
27 | daemon atd | |
28 | else | |
29 | echo "atd already is running" | |
30 | fi | |
5d26daad | 31 | touch /var/lock/subsys/atd |
283c91e0 | 32 | ;; |
33 | stop) | |
34 | show Stopping at daemon | |
35 | killproc atd | |
36 | rm -f /var/lock/subsys/atd | |
37 | ;; | |
38 | reload|restart) | |
39 | $0 stop | |
40 | $0 start | |
41 | ;; | |
42 | status) | |
43 | status atd | |
44 | ;; | |
45 | *) | |
46 | echo "Usage: $0 {start|stop|restart|reload|status}" | |
47 | exit 1 | |
48 | esac | |
49 | ||
50 | exit 0 |