/[packages]/cauldron/backuppc/current/SOURCES/backuppc.init
ViewVC logotype

Contents of /cauldron/backuppc/current/SOURCES/backuppc.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 234949 - (show annotations) (download)
Tue May 8 22:01:24 2012 UTC (11 years, 9 months ago) by pterjan
File size: 1603 byte(s)
- Fix initscript's LSB header
- Fix License tag
1 #!/bin/sh
2 #
3 # chkconfig: 345 55 45
4 # description: Starts the BackupPC server
5
6 ### BEGIN INIT INFO
7 # Provides: cfenvd
8 # Required-Start: $network
9 # Required-Stop: $network
10 # Default-Start: 3 4 5
11 # Short-Description: Starts the BackupPC server
12 # Description: This startup script launches the BackupPC server
13 ### END INIT INFO
14
15 # Local variables
16 NAME=backuppc
17 BINARY=/usr/share/backuppc/bin/BackupPC
18 LOCKFILE=/var/lock/subsys/$NAME
19
20 # Source function library.
21 . /etc/rc.d/init.d/functions
22
23 # Source networking configuration.
24 . /etc/sysconfig/network
25
26 # Check that networking is up.
27 [ "$NETWORKING" = "no" ] && exit 0
28
29 # Load service configuration
30 [ -f /etc/sysconfig/backuppc ] && . /etc/sysconfig/xinetd
31
32 start() {
33 # Check if it is already running
34 if [ ! -f $LOCKFILE ]; then
35 echo -n "Starting $NAME"
36 daemon --user backuppc $BINARY -d
37 RETVAL=$?
38 [ $RETVAL -eq 0 ] && touch $LOCKFILE
39 echo
40 fi
41 }
42
43 stop() {
44 echo -n "Stopping $NAME"
45 killproc $BINARY
46 RETVAL=$?
47 [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
48 echo
49 }
50
51 function restart() {
52 stop
53 start
54 }
55
56 reload() {
57 echo -n "Reloading $NAME configuration"
58 killproc $BINARY -HUP
59 RETVAL=$?
60 echo
61 }
62
63 RETVAL=0
64
65 case "$1" in
66 start)
67 start
68 ;;
69 stop)
70 stop
71 ;;
72 restart)
73 restart
74 ;;
75 reload)
76 reload
77 ;;
78 condrestart)
79 if [ -f $LOCKFILE ]; then
80 restart
81 fi
82 ;;
83 condreload)
84 if [ -f $LOCKFILE ]; then
85 reload
86 fi
87 ;;
88 status)
89 status $BINARY
90 ;;
91 *)
92 echo "Usage: $0 {start|stop|restart|reload|condrestart|condreload|status}"
93 RETVAL=1
94 ;;
95 esac
96
97 exit $RETVAL

  ViewVC Help
Powered by ViewVC 1.1.30