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

Revision 2193, 2.2 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/bbstored
14#   and its symbolic link
15# /(usr/)sbin/rcbbstored
16#
17### BEGIN INIT INFO
18# Provides:          bbstored
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 server side daemon
26# Description: Server daemon for the BoxBackup software,
27#       to which bbackupd clients connect.
28### END INIT INFO
29#
30
31# Check for missing binaries (stale symlinks should not happen)
32BBSTORED_BIN=@sbindir_expanded@/bbstored
33if [ ! -x $BBSTORED_BIN ] ; then
34        echo "$BBSTORED_BIN not installed"
35        exit 5
36fi
37
38. /etc/rc.status
39
40# Reset status of this service
41rc_reset
42
43case "$1" in
44        start)
45        echo -n "Starting bbstored "
46        startproc $BBSTORED_BIN
47        rc_status -v
48        ;;
49
50    stop)
51        echo -n "Shutting down bbstored "
52        killproc -TERM $BBSTORED_BIN
53        rc_status -v
54        ;;
55
56    try-restart|condrestart)
57        if test "$1" = "condrestart"; then
58                echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
59        fi
60        $0 status
61        if test $? = 0; then
62                $0 restart
63        else
64                rc_reset        # Not running is not a failure.
65        fi
66        rc_status
67        ;;
68
69    restart)
70        $0 stop
71        $0 start
72        rc_status
73        ;;
74
75    force-reload)
76        echo -n "Reload service bbstored "
77        killproc -HUP $BBSTORED_BIN
78        rc_status -v
79        ;;
80
81    reload)
82        echo -n "Reload service bbstored  "
83        killproc -HUP $BBSTORED_BIN
84        rc_status -v
85        ;;
86
87    status)
88        echo -n "Checking for service bbstored "
89        checkproc $BBSTORED_BIN
90        rc_status -v
91        ;;
92
93    probe)
94        test @sysconfdir_expanded@/box/bbstored.conf \
95                -nt @localstatedir_expanded@/run/bbstored.pid && echo reload
96        ;;
97
98    *)
99        echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
100        exit 1
101        ;;
102
103esac
104rc_exit
Note: See TracBrowser for help on using the repository browser.