/etc/init.d/kopano-gateway is in kopano-gateway 8.5.5-0ubuntu1.
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 | #! /bin/sh
#
### BEGIN INIT INFO
# Provides: kopano-gateway
# Required-Start: $syslog $network $remote_fs
# Required-Stop: $syslog $network $remote_fs
# Should-Start: kopano-server
# Should-Stop: kopano-server
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Kopano Collaboration Platform's POP3/IMAP Gateway
# Description: The Kopano Gateway allows users
# to access their email using the POP3 or IMAP protocol.
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
GATEWAY=/usr/sbin/kopano-gateway
DESC="Kopano gateway"
NAME=`basename $GATEWAY`
#QUIETDAEMON=--quiet
PIDFILE=/var/run/kopano-gateway.pid
test -x $GATEWAY || exit 0
# Include kopano defaults if available
if [ -f /etc/default/kopano ] ; then
. /etc/default/kopano
fi
if [ -z "$KOPANO_LOCALE" ]; then
KOPANO_LOCALE="C"
fi
if [ -e "$GATEWAY_CONFIG" ]; then
GATEWAY_OPTS="$GATEWAY_OPTS -c $GATEWAY_CONFIG"
fi
#set -e
. /lib/lsb/init-functions
case "$1" in
start)
if [ "$GATEWAY_ENABLED" = "no" ]; then
log_warning_msg "Kopano POP3/IMAP Gateway daemon not enabled in /etc/default/kopano ... not starting"
exit 0
fi
log_begin_msg "Starting $DESC: $NAME"
export LC_ALL=$KOPANO_LOCALE
export LANG=$KOPANO_LOCALE
start-stop-daemon --start $QUIETDAEMON --pidfile $PIDFILE --exec $GATEWAY -- $GATEWAY_OPTS
log_end_msg $?
unset LC_ALL LANG
;;
stop)
log_begin_msg "Stopping $DESC: $NAME"
start-stop-daemon --stop $QUIETDAEMON --pidfile $PIDFILE --retry TERM/15/KILL --exec $GATEWAY
RETVAL=$?
rm -f $PIDFILE
log_end_msg $RETVAL
;;
restart)
$0 stop
$0 start
;;
status)
status_of_proc "$GATEWAY" "$NAME" && exit 0 || exit $?
;;
reload|force-reload)
log_begin_msg "Reloading $DESC: $NAME"
start-stop-daemon --stop $QUIETDAEMON --signal HUP --pidfile $PIDFILE --exec $GATEWAY
log_end_msg $?
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force|force-reload|status}" >&2
exit 1
;;
esac
exit 0
|