SOURCES: kerneloops.init - PLDized
paszczus
paszczus at pld-linux.org
Mon Jul 14 13:38:06 CEST 2008
Author: paszczus Date: Mon Jul 14 11:38:06 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- PLDized
---- Files affected:
SOURCES:
kerneloops.init (1.1 -> 1.2)
---- Diffs:
================================================================
Index: SOURCES/kerneloops.init
diff -u SOURCES/kerneloops.init:1.1 SOURCES/kerneloops.init:1.2
--- SOURCES/kerneloops.init:1.1 Sat May 24 10:35:53 2008
+++ SOURCES/kerneloops.init Mon Jul 14 13:38:00 2008
@@ -10,64 +10,69 @@
# Source function library.
. /etc/rc.d/init.d/functions
-exec="/usr/sbin/kerneloops"
-prog=$(basename $exec)
sconf="/etc/kerneloops.conf"
-lockfile=/var/lock/subsys/$prog
-[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+OPTS=
-start() {
- echo -n $"Starting $prog:"
- daemon $prog $OPTS
- retval=$?
- echo
- [ $retval -eq 0 ] && touch $lockfile
- return $retval
-}
+# Source config
+if [ -f /etc/sysconfig/kerneloops ] ; then
+ . /etc/sysconfig/kerneloops
+fi
-stop() {
- echo -n $"Stopping $prog: "
- killproc $prog
- retval=$?
- echo
- [ $retval -eq 0 ] && rm -f $lockfile
- return $retval
-}
-
-restart() {
- stop
- start
-}
-reload() {
- restart
-}
-
-force_reload() {
- restart
+start() {
+ if [ ! -f /var/lock/subsys/kerneloops ]; then
+ umask 077
+ msg_starting kerneloops
+ daemon kerneloops $OPTS
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/kerneloops
+ else
+ msg_already_running kerneloops
+ fi
}
-fdr_status() {
- status $prog
+stop() {
+ if [ -f /var/lock/subsys/kerneloops ]; then
+ msg_stopping kerneloops
+ killproc kerneloops
+ rm -f /var/lock/subsys/kerneloops
+ else
+ msg_not_running kerneloops
+ fi
+}
+
+condrestart() {
+ if [ -f /var/lock/subsys/kerneloops ]; then
+ stop
+ start
+ else
+ msg_not_running kerneloops
+ RETVAL=$1
+ fi
}
-
+RETVAL=0
case "$1" in
- start|stop|restart|reload)
- $1
- ;;
- force-reload)
- force_reload
- ;;
- status)
- fdr_status
- ;;
- condrestart|try-restart)
- [ -f $lockfile ] || restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
- exit 1
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ status)
+ status kerneloops
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|status}"
+ exit 3
esac
+exit $RETVAL
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kerneloops.init?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list