rpms/at/devel at.spec,1.68,1.69 atd.init,1.8,1.9

Marcela Mašláňová mmaslano at fedoraproject.org
Fri Oct 24 13:14:35 UTC 2008


Author: mmaslano

Update of /cvs/pkgs/rpms/at/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17598

Modified Files:
	at.spec atd.init 
Log Message:
* Fri Oct 24 2008 Marcela Mašláňová <mmaslano at redhat.com> - 3.1.10-26
- update init script according to SysVInitScript



Index: at.spec
===================================================================
RCS file: /cvs/pkgs/rpms/at/devel/at.spec,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- at.spec	17 Sep 2008 08:52:38 -0000	1.68
+++ at.spec	24 Oct 2008 13:14:05 -0000	1.69
@@ -6,7 +6,7 @@
 Summary: Job spooling tools
 Name: at
 Version: 3.1.10
-Release: 25%{?dist}
+Release: 26%{?dist}
 License: GPLv2+
 Group: System Environment/Daemons
 URL: http://ftp.debian.org/debian/pool/main/a/at
@@ -187,6 +187,9 @@
 %attr(4755,root,root)	%{_bindir}/at
 
 %changelog
+* Fri Oct 24 2008 Marcela Mašláňová <mmaslano at redhat.com> - 3.1.10-26
+- update init script according to SysVInitScript
+
 * Tue Sep 16 2008 Marcela Maslanova <mmaslano at redhat.com> - 3.1.10-25
 - thanks dwalsh for selinux patch, which fix #460873
 


Index: atd.init
===================================================================
RCS file: /cvs/pkgs/rpms/at/devel/atd.init,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- atd.init	18 Jul 2008 12:55:00 -0000	1.8
+++ atd.init	24 Oct 2008 13:14:05 -0000	1.9
@@ -1,95 +1,111 @@
-#!/bin/bash
+#!/bin/sh
 #
-#	/etc/rc.d/init.d/atd
+# atd Starts/stop the "at" daemon
 #
-# Starts the "at" daemon
-#
-# chkconfig: 345 95 5
+# chkconfig:   345 95 5
 # 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.
-. /etc/init.d/functions
+### BEGIN INIT INFO
+# Provides: atd at batch
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Default-Start: 345
+# Default-Stop: 95
+# Short-Description: Starts/stop the "at" daemon
+# 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.
+### END INIT INFO
 
-# pull in sysconfig settings
-[ -f /etc/sysconfig/atd ] && . /etc/sysconfig/atd
+# Source function library.
+. /etc/rc.d/init.d/functions
 
-RETVAL=0
+exec=/usr/sbin/atd
 prog="atd"
-ATD=/usr/sbin/atd
-LOCK_FILE=/var/lock/subsys/atd
+config=/etc/sysconfig/atd
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
 
-[ -f /etc/sysconfig/atd ] || exit 6
-	    
 start() {
-	# Check if atd is already running
-	echo -n $"Starting $prog: "
-	daemon $ATD $OPTS && success || failure
-	RETVAL=$?
-	[ "$RETVAL" = 0 ] && touch $LOCK_FILE
-	echo
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon $exec $OPTS && success || failure
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
 }
 
 stop() {
-	echo -n $"Stopping $prog: "
-    if [ -n "`pidfileofproc $ATD`" ] ; then
-        killproc $ATD
+    echo -n $"Stopping $prog: "
+    if [ -n "`pidfileofproc $exec`" ] ; then
+        killproc $exec
 		RETVAL=3
     else
         failure $"Stopping $prog"
     fi
-    RETVAL=$?
-    [ "$RETVAL" = 0 ] && rm -f $LOCK_FILE
+    retval=$?
     echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
 }
 
-
 restart() {
-	stop
-	start
-}	
+    stop
+    start
+}
 
 reload() {
-	echo -n $"Reloading $prog: "
-	if [ -n "`pidfileofproc $ATD`" ]; then
-		killproc $ATD -HUP
-	else
-		failure $"Reloading $prog"
-	fi
-	RETVAL=$?
-	echo
-}	
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    # run checks to determine if the service is running or use generic status
+    status $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
 
 case "$1" in
-start)
-	start
-	;;
-stop)
-	stop
-	;;
-restart)
-	stop
-	start
-	;;
-reload)
-	reload
-	;;
-condrestart)
-	if [ -f  $LOCK_FILE ]; then
-		if [ "$RETVAL" = 0 ]; then
-			stop
-			sleep 3
-			start
-		fi
-	fi
-	;;
-status)
-	status $ATD
-	;;
-*)
-	echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
-	RETVAL=3
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
 esac
-exit $RETVAL
+exit $?




More information about the fedora-extras-commits mailing list