Logoj0ke.net Open Build Service > Projects > ha:testing > lsyncd > lsyncd-suse.init
Sign Up | Log In

File lsyncd-suse.init of Package lsyncd (Revision af58157a9d0c783c943a0b8842ea2493)

Currently displaying revision af58157a9d0c783c943a0b8842ea2493, show latest

x
 
1
#!/bin/bash
2
#
3
### BEGIN INIT INFO
4
# Provides:lsyncd
5
# Required-Start:
6
# Required-Stop:
7
# Default-Start:3 5
8
# Default-Stop:0 1 2 6
9
# Short-Description:Start lsyncd
10
# Description:Lsyncd uses rsync to synchronize local directories with a remote machine running rsyncd.
11
### END INIT INFO
12
13
config="/etc/lsyncd/lsyncd.conf"
14
lsyncd="/usr/bin/lsyncd"
15
prog="lsyncd"
16
17
. /etc/rc.status
18
19
[ -f /etc/sysconfig/lsyncd ] && . /etc/sysconfig/lsyncd
20
21
rc_reset
22
23
case "$1" in
24
    start)
25
        echo -n "Starting $prog: "
26
        $lsyncd  -log Exec $config ${OPTIONS}
27
        rc_status -v
28
    ;;
29
    stop)
30
        echo -n "Shutting down $prog: "
31
        /bin/kill -9 `/sbin/pidof lsyncd`
32
        until [ -z $(/sbin/pidof lsyncd) ]; do :; done
33
        rc_status -v
34
    ;;
35
    restart)
36
        $0 stop
37
        $0 start
38
        rc_status
39
    ;;
40
    status)
41
        echo -n "$prog status:"
42
        rc_status -v
43
    ;;
44
    *)
45
        echo "Usage: $0 {start|stop|restart|status}"
46
        exit 1
47
    ;;
48
esac
49
50
rc_exit
51