source: box/trunk/contrib/redhat/bbstored.in @ 2094

Revision 2094, 1.4 KB checked in by jamesog, 4 years ago (diff)
  • Move all commands from bin to sbin on Unix platforms
  • Update all associated docs and contributed distribution files
  • Property svn:eol-style set to LF
Line 
1#! /bin/bash
2#
3# bbstored          Start/Stop the box backup server daemon.
4#
5# chkconfig: 345 93 07
6# description: bbstored is the server side daemon for Box Backup, \
7#              a completely automatic on-line backup system.
8# processname: bbstored
9# config: @sysconfdir_expanded@/box
10# pidfile: @localstatedir_expanded@/bbstored.pid
11
12# Source function library.
13. /etc/init.d/functions
14
15RETVAL=0
16
17# See how we were called.
18
19prog="bbstored"
20
21# Check that configuration exists.
22[ -f @sysconfdir_expanded@/box/$prog.conf ] || exit 0
23
24start() {
25        echo -n $"Starting $prog: "
26        daemon @sbindir_expanded@/$prog
27        RETVAL=$?
28        echo
29        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
30        return $RETVAL
31}
32
33stop() {
34        echo -n $"Stopping $prog: "
35        killproc @sbindir_expanded@/$prog
36        RETVAL=$?
37        echo
38        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
39        return $RETVAL
40}
41
42rhstatus() {
43        status @sbindir_expanded@/$prog
44}
45
46restart() {
47        stop
48        start
49}
50
51reload() {
52        echo -n $"Reloading $prog configuration: "
53        killproc @sbindir_expanded@/$prog -HUP
54        retval=$?
55        echo
56        return $RETVAL
57}
58
59case "$1" in
60  start)
61        start
62        ;;
63  stop)
64        stop
65        ;;
66  restart)
67        restart
68        ;;
69  reload)
70        reload
71        ;;
72  status)
73        rhstatus
74        ;;
75  condrestart)
76        [ -f /var/lock/subsys/$prog ] && restart || :
77        ;;
78  *)
79        echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
80        exit 1
81esac
82
83exit $?
Note: See TracBrowser for help on using the repository browser.