]> git.pld-linux.org Git - packages/at.git/blobdiff - atd.init
- replace non-existent %chkconfig_{post,preun} macros with
[packages/at.git] / atd.init
index 94ce01c5a40d8d2e9a90f87acb3d2e44efcd1bcf..16fb6a916aca4d7a8995de44b773b50d95248bf5 100644 (file)
--- a/atd.init
+++ b/atd.init
@@ -1,33 +1,38 @@
-#!/bin/bash
+#!/bin/sh
 #
-#      /etc/rc.d/init.d/atd
+# atd          Runs commands scheduled by the at command
 #
-# Starts the at daemon
+# chkconfig:   345 40 60
 #
-# chkconfig: 345 40 60
-# description: Runs commands scheduled by the at command at the time \
-#    specified when at was run, and runs batch commands when the load \
-#    average is low enough.
-# processname: atd
+# description: Runs commands scheduled by the at command at the time \
+#              specified when at was run, and runs batch commands when \
+#              the load average is low enough.
+#
+# processname: atd
+
 
-# Source function library.
+# Source function library
 . /etc/rc.d/init.d/functions
 
-test -x /usr/sbin/atd || exit 0
-#
-#      See how we were called.
-#
+# Get service config
+[ -f /etc/sysconfig/atd ] && . /etc/sysconfig/atd
+
+
+# See how we were called.
 case "$1" in
   start)
-       # Check if atd is already running
+       # Check if the service is already running?
        if [ ! -f /var/lock/subsys/atd ]; then
-           show Starting at daemon
-           daemon atd
-           touch /var/lock/subsys/atd
+               msg_starting at
+               daemon atd
+       else
+               msg_Already_Running atd
+               exit 1
        fi
+        touch /var/lock/subsys/atd
        ;;
   stop)
-       show Stopping at daemon
+       msg_stopping at
        killproc atd
        rm -f /var/lock/subsys/atd
        ;;
@@ -39,7 +44,7 @@ case "$1" in
        status atd
        ;;
   *)
-       echo "Usage: $0 {start|stop|restart|reload|status}"
+       msg_Usage "$0 {start|stop|restart|reload|status}"
        exit 1
 esac
 
This page took 0.084029 seconds and 4 git commands to generate.