3 # fedmsg-relay - This init script runs the FedMsg Relay
6 # description: Enabled the fedmsg relay daemon
7 # processname: fedmsg-relay
8 # config: /etc/fedmsg.d/*
9 # pidfile: /var/run/fedmsg/fedmsg-relay.pid
11 # Source function library
12 . /etc/rc.d/init.d/functions
15 . /etc/sysconfig/network
17 # Check that networking is up.
18 if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
20 msg_network_down "FedMsg Active<->Passive Relay"
31 PIDFILE=/var/run/fedmsg/$PROG.pid
33 # Get service config - may override defaults
34 [ -f /etc/sysconfig/fedmsg-relay ] && . /etc/sysconfig/fedmsg-relay
37 # Check if the service is already running?
38 if [ -f /var/lock/subsys/fedmsg-relay ]; then
39 msg_already_running "FedMsg Active<->Passive Relay"
43 msg_starting "FedMsg Active<->Passive Relay"
44 daemon --user $USER --fork --makepid --pidfile $PIDFILE $PROG $OPTIONS
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fedmsg-relay
50 if [ ! -f /var/lock/subsys/fedmsg-relay ]; then
51 msg_not_running "FedMsg Active<->Passive Relay"
56 msg_stopping "FedMsg Active<->Passive Relay"
57 killproc --pidfile $PIDFILE fedmsg-relay -TERM
58 rm -f /var/lock/subsys/fedmsg-relay
62 if [ ! -f /var/lock/subsys/fedmsg-relay ]; then
63 msg_not_running "FedMsg Active<->Passive Relay"
73 # See how we were called.
92 status --pidfile $PIDFILE fedmsg-relay
96 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"