Author: nanardon
Date: Fri Feb  9 21:29:47 2007
New Revision: 118629

Added:
   packages/cooker/incron/current/SOURCES/incron.initscript
Modified:
   packages/cooker/incron/current/SPECS/incron.spec

Log:
- add an initscript

Added: packages/cooker/incron/current/SOURCES/incron.initscript
==============================================================================
--- (empty file)
+++ packages/cooker/incron/current/SOURCES/incron.initscript    Fri Feb  9 
21:29:47 2007
@@ -0,0 +1,96 @@
+#! /bin/bash
+#
+# incron          Start/Stop the cron clock daemon.
+#
+# chkconfig: 2345 90 60
+# description: incron is an "inotify cron" system. It works like the \
+#              regular cron but is driven by filesystem events instead \
+#              of time periods. It contains two programs, a daemon \
+#              called "incrond" (analogous to crond) and a table \
+#              manipulator "incrontab" (like "crontab").
+# processname: incrond
+# config: /etc/incrontab
+# pidfile: /var/run/incrond.pid
+#
+### BEGIN INIT INFO
+# Provides: incron
+# Required-Start: $syslog
+# Required-Stop: $syslog
+# Default-Start: 2 3 4 5
+# Short-Description: An inotify cron based
+# Description: incron is an "inotify cron" system. It works like the
+#              regular cron but is driven by filesystem events instead
+#              of time periods. It contains two programs, a daemon
+#              called "incrond" (analogous to crond) and a table
+#              manipulator "incrontab" (like "crontab").
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+RETVAL=0
+
+# See how we were called.
+  
+prog="incrond"
+
+start() {
+       gprintf "Starting %s: " "$prog"
+       daemon incrond < /dev/null
+       RETVAL=$?
+       echo
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/incrond
+       return $RETVAL
+}
+
+stop() {
+       gprintf "Stopping %s: " "$prog"
+       killproc incrond
+       RETVAL=$?
+       echo
+       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/incrond
+       return $RETVAL
+}      
+
+rhstatus() {
+       status incrond
+}      
+
+restart() {
+       stop
+       start
+}      
+
+reload() {
+       gprintf "Reloading cron daemon configuration: "
+       killproc incrond -HUP
+       retval=$?
+       echo
+       return $RETVAL
+}      
+
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       restart
+       ;;
+  reload)
+       reload
+       ;;
+  status)
+       rhstatus
+       ;;
+  condrestart)
+       [ -f /var/lock/subsys/incrond ] && restart || :
+       ;;
+  *)
+       gprintf "Usage: %s {start|stop|status|reload|restart|condrestart}\n" 
"$0"
+       exit 1
+esac
+
+exit $?

Modified: packages/cooker/incron/current/SPECS/incron.spec
==============================================================================
--- packages/cooker/incron/current/SPECS/incron.spec    (original)
+++ packages/cooker/incron/current/SPECS/incron.spec    Fri Feb  9 21:29:47 2007
@@ -1,12 +1,13 @@
 %define name incron
 %define version 0.5.3
-%define release %mkrel 1
+%define release %mkrel 2
 
 Summary: An inotify based cron daemon
 Name: %{name}
 Version: %{version}
 Release: %{release}
 Source0: %{name}-%{version}.tar.bz2
+Source1: incron.initscript
 Patch0:  incron-Makefile-missing-man.patch
 License: GPL
 Group: System/Servers
@@ -42,6 +43,15 @@
 
 install -m644 incron.conf.example %buildroot%_sysconfdir/incron.conf
 
+mkdir -p %buildroot%_sysconfdir/init.d/
+install -m 755 %SOURCE1 %buildroot%_sysconfdir/init.d/incrond
+
+%post
+%_post_service incrond
+
+%preun
+%_preun_service incrond
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -56,4 +66,4 @@
 %_sysconfdir/incron.conf.example
 %config(noreplace) %_sysconfdir/incron.conf
 %_mandir/man?/*
-
+%_sysconfdir/init.d/incrond

Reply via email to