File: sysVinit-launcher

package info (click to toggle)
fcron 3.0.1-1.3
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 3,028 kB
  • ctags: 642
  • sloc: ansic: 7,978; sh: 1,107; makefile: 352; perl: 57
file content (76 lines) | stat: -rwxr-xr-x 1,567 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/sh
#
# chkconfig: 2345 40 60
# description: fcron is a scheduler especially useful for people \
#              who are not running their system all the time.
# processname: fcron
# pidfile: /var/run/fcron.pid
# config: /var/spool/fcron/*
# $Id: sysVinit-launcher,v 1.10 2006/01/11 00:54:44 thib Exp thib $

export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"

FUNCTION=0
SBIN=@@DESTSBIN@

# Source function library.
if test -f /etc/init.d/functions; then
    . /etc/rc.d/init.d/functions
    FUNCTION=1
    STARTCMD="daemon $SBIN/fcron -b"
    STOPCMD="killproc fcron"
    FINALECHO="echo"
elif start-stop-daemon --version > /dev/null; then
    STARTCMD="start-stop-daemon --start --quiet --exec $SBIN/fcron -- -b"
    STOPCMD="start-stop-daemon --stop --quiet --exec $SBIN/fcron"
    FINALECHO="echo ."
else
    STARTCMD="$SBIN/fcron -b"
    STOPCMD="killall -TERM $SBIN/fcron"
    FINALECHO="echo ."
fi

RETVAL=0


#  See how we were called.
case "$1" in
  start)
	echo -n "Starting fcron"
	$STARTCMD
	RETVAL=$?
	if test -d /var/lock/subsys/; then
	    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fcron
	fi
	$FINALECHO
	;;
  stop)
	echo -n "Shutting down fcron"
	$STOPCMD
	RETVAL=$?
	if test -d /var/lock/subsys/; then
	    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/fcron
	fi
	$FINALECHO
	;;
  status)
	if test $FUNCTION -eq 1; then
	    status fcron
	fi
	RETVAL=$?
	;;
  restart)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  reload)
	killall -HUP fcron
	RETVAL=$?
	;;        
  *)
	echo "Usage: fcron {start|stop|status|restart}"
	exit 1
esac

exit $RETVAL