/etc/init.d/postfix-cluebringer is in postfix-cluebringer 2.0.10-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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | #!/bin/sh
### BEGIN INIT INFO
# Provides: postfix-cluebringer
# Required-Start: $local_fs $remote_fs $syslog $named $network
# Required-Stop: $local_fs $remote_fs $syslog $named $network
# Should-Start: mysql postgresql-8.3 postgresql-8.4
# Should-Stop: mysql postgresql-8.3 postgresql-8.4
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starting postfix policy daemon
# Description: cluebringer is the postfix policy daemon v2.0
### END INIT INFO
NAME="cbpolicyd"
DAEMON=/usr/sbin/cbpolicyd
LIB=/usr/lib/postfix-cluebringer
PIDDIR=/var/run/cluebringer
PIDFILE=${PIDDIR}/$NAME.pid
RUN_CLUEBRINGER="NO"
CONFIG_FILE=""
[ ! -r /etc/default/postfix-cluebringer ] || . /etc/default/postfix-cluebringer
. /lib/lsb/init-functions
PATH=/bin:/usr/bin:/sbin:/usr/sbin
if [ "$CHUID" = "" ]; then
CHUID="root"
fi
# Check for the existence of the configuration file
if [ ! -f $CONFIG_FILE ]; then
log_failure_msg "No config file found."
exit 0;
fi
# Check that the default has been changed
if [ "$RUN_CLUEBRINGER" = "NO" ]; then
log_failure_msg "Please edit /etc/default/cluebringer to run postfix-cluebringer."
exit 0;
fi
[ -x $DAEMON ] || exit 0
start() {
if [ "$DAEMON_OPTIONS" = "" ]; then
DAEMON_OPTIONS="--config=$CONFIG_FILE"
fi
# create run dirs:
if [ ! -d ${PIDDIR} ]; then
mkdir ${PIDDIR}
fi
chown -R ${CHUID}:www-data ${PIDDIR}
chmod -R u+rwx,g-w,o= ${PIDDIR}
# Test if we are already running the daemon
start-stop-daemon --start --quiet \
--pidfile $PIDFILE \
--chuid $CHUID \
--test \
--exec $DAEMON -- $DAEMON_OPTIONS > /dev/null || return 1
# If all is well we start
start-stop-daemon --quiet --start \
--pidfile $PIDFILE \
--chuid $CHUID \
--exec $DAEMON -- $DAEMON_OPTIONS || return 2
}
stop() {
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
if [ -f $PIDFILE ]; then
rm -f $PIDFILE || true
fi
return "$RETVAL"
}
case "$1" in
start)
log_daemon_msg "Starting postfix policy daemon" "cluebringer"
start
case "$?" in
0|1)
log_end_msg 0
;;
2) log_end_msg 1
;;
esac
;;
stop)
log_daemon_msg "Stopping postfix policy daemon" "cluebringer"
stop
case "$?" in
0|1)
log_end_msg 0
;;
2)
log_failure_msg "Failed"
log_end_msg 1
;;
esac
;;
restart|reload|force-reload)
log_action_begin_msg "Restarting postfix policy daemon cluebringer"
log_action_cont_msg "Stopping"
stop
case "$?" in
0|1)
log_action_cont_msg "Starting"
start
case "$?" in
0|1)
log_action_end_msg 0
;;
2)
log_failure_msg "Failed"
log_action_end_msg 1
;;
esac
;;
*)
log_failure_msg "Failed"
log_action_end_msg 1
;;
esac
;;
status)
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
;;
*)
echo 'Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart|status}'
exit 3
;;
esac
exit 0
|