/usr/share/fedmsg/initsys/sysv/fedmsg-relay.init is in python-fedmsg 0.7.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | #!/bin/bash
# fedmsg-relay - This init script runs the FedMsg Relay
#
# chkconfig: - 25 85
# description: Enabled the fedmsg relay daemon
# processname: fedmsg-relay
# config: /etc/fedmsg.d/*
# pidfile: /var/run/fedmsg/fedmsg-relay.pid
### BEGIN INIT INFO
# Provides: fedmsg-relay
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start:
# Default-Stop: 0 1 6
# Short-Description: start or stop the fedmsg-relay
# Description: Starts a fedmsg-hub configured to relay special messages.
### END INIT INFO
# Source function library.
. /etc/init.d/functions
PROG=fedmsg-relay
USER=fedmsg
PIDFILE=/var/run/fedmsg/$PROG.pid
OPTIONS=--daemon
SUBSYS=/var/lock/subsys/$PROG
start() {
echo -n "Starting FedMsg Relay: "
if [ -f $PIDFILE.lock ]; then
echo FedMsg Relay already running
exit 2;
fi
if [ ! -d /var/run/fedmsg ]; then
mkdir /var/run/fedmsg
chown $USER:$USER /var/run/fedmsg
fi
daemon --user $USER $PROG $OPTIONS
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
success
touch $SUBSYS
else
failure
fi
}
stop() {
echo -n $"Stopping FedMsg Relay: "
killproc -p ${PIDFILE} $PROG
echo
rm -f ${SUBSYS}
RETVAL=$?
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
if [ -f $PIDFILE ]; then
echo $"FedMsg Relay is running."
RETVAL=0
else
echo $"FedMsg Relay is not running."
RETVAL=3
fi
;;
restart)
stop
start
;;
*)
echo "Usage: {start|stop|status|reload|restart}"
exit 1
;;
esac
exit $?
|