source: box/trunk/contrib/suse/bbackupd.in @ 2193

Revision 2193, 2.3 KB checked in by chris, 4 years ago (diff)

Correct locations for PID files in SuSE initscript

  • Property svn:eol-style set to LF
Line 
1#!/bin/sh
2#
3# Copyright (c)2004, Nothing But Net Limited
4#       <chris.smith@nothingbutnet.co.nz>
5#
6######################################################################
7# RELEASED AND PROVIDED TO YOU UNDER THE SAME LICENCE AS THE BOXBACKUP
8# SUITE OF PROGRAMS. LICENCE MAY BE VIEWED HERE:
9#
10# http://www.boxbackup.org/license.html
11######################################################################
12#
13# /etc/init.d/bbackupd
14#   and its symbolic link
15# /(usr/)sbin/rcbbackupd
16#
17### BEGIN INIT INFO
18# Provides:          bbackupd
19# Required-Start:    $named $network $local_fs $syslog
20# X-UnitedLinux-Should-Start: $time ypbind sendmail
21# Required-Stop:     $named $network $localfs $syslog
22# X-UnitedLinux-Should-Stop: $time ypbind sendmail
23# Default-Start:     3 5
24# Default-Stop:      0 1 2 6
25# Short-Description: BoxBackup client side daemon
26# Description: Client daemon for the BoxBackup software       
27#       that allows you to communicate with a bbstored server.
28### END INIT INFO
29
30# Check for missing binaries (stale symlinks should not happen)
31BBACKUPD_BIN=@sbindir_expanded@/bbackupd
32if [ ! -x $BBACKUPD_BIN ] ; then
33        echo "$BBACKUPD_BIN not installed"
34        exit 5
35fi
36
37. /etc/rc.status
38
39# Reset status of this service
40rc_reset
41
42case "$1" in
43        start)
44                echo -n "Starting bbackupd "
45                startproc $BBACKUPD_BIN
46                rc_status -v
47                ;;
48
49    stop)
50                echo -n "Shutting down bbackupd "
51                killproc -TERM $BBACKUPD_BIN
52                rc_status -v
53                ;;
54
55    try-restart|condrestart)
56                if test "$1" = "condrestart"; then
57                        echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
58                fi
59                $0 status
60                if test $? = 0; then
61                        $0 restart
62                else
63                        rc_reset        # Not running is not a failure.
64                fi
65                rc_status
66                ;;
67
68    restart)
69                $0 stop
70                $0 start
71                rc_status
72                ;;
73
74    force-reload)
75                echo -n "Reload service bbackupd "
76                killproc -HUP $BBACKUPD_BIN
77                rc_status -v
78                ;;
79
80    reload)
81                echo -n "Reload service bbackupd  "
82                killproc -HUP $BBACKUPD_BIN
83                rc_status -v
84                ;;
85
86    status)
87                echo -n "Checking for service bbackupd "
88                checkproc $BBACKUPD_BIN
89                rc_status -v
90                ;;
91
92    probe)
93                test @sysconfdir_expanded@/box/bbackupd.conf \
94                        -nt @localstatedir_expanded@/bbackupd/bbackupd.pid \
95                && echo reload
96                ;;
97
98    *)
99                echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
100                exit 1
101
102esac
103rc_exit
Note: See TracBrowser for help on using the repository browser.