summaryrefslogtreecommitdiffstats
path: root/daemons/pacemakerd/pacemaker.upstart.in
blob: 7a54bc0ea8434aca872ec87258e6a668522891b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# pacemaker - High-Availability cluster resource manager
#
# Starts pacemakerd

stop on runlevel [0123456]
kill timeout 3600
respawn

env prog=pacemakerd
env sysconf=@CONFIGDIR@/pacemaker
env rpm_lockdir=@localstatedir@/lock/subsys
env deb_lockdir=@localstatedir@/lock

script
    [ -f "$sysconf" ] && . "$sysconf"
    exec $prog
end script

post-start script
    [ -f "$sysconf" ] && . "$sysconf"
    [ -z "$LOCK_FILE" -a -d "$rpm_lockdir" ] && LOCK_FILE="$rpm_lockdir/pacemaker"
    [ -z "$LOCK_FILE" -a -d "$deb_lockdir" ] && LOCK_FILE="$deb_lockdir/pacemaker"
    touch "$LOCK_FILE"
    pidof $prog > "@localstatedir@/run/$prog.pid"
end script

post-stop script
    [ -f "$sysconf" ] && . "$sysconf"
    [ -z "$LOCK_FILE" -a -d "$rpm_lockdir" ] && LOCK_FILE="$rpm_lockdir/pacemaker"
    [ -z "$LOCK_FILE" -a -d "$deb_lockdir" ] && LOCK_FILE="$deb_lockdir/pacemaker"
    rm -f "$LOCK_FILE"
    rm -f "@localstatedir@/run/$prog.pid"
end script