/etc/init.d/mono-xsp2 is in mono-xsp2 2.10-1build1.
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 | #! /bin/sh
### BEGIN INIT INFO
# Provides: mono-xsp2
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Mono XSP2
# Description: Debian init script for Mono XSP2.
### END INIT INFO
#
# Written by Pablo Fischer <pablo@pablo.com.mx>
# Dylan R. E. Moonfire <debian@mfgames.com>
# Modified for Debian GNU/Linux
#
# Version: @(#)mono-xsp2 pablo@pablo.com.mx
#
# Variables
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/xsp2
NAME=mono-xsp2
DESC="XSP 2.0 WebServer"
DEFAULT=/etc/default/$NAME
CFGDIR=/etc/xsp2
VIRTUALFILE=$CFGDIR/debian.webapp
MONO_SHARED_DIR=/var/run/$NAME
start_boot=false
# Use LSB
. /lib/lsb/init-functions
# If we don't have the basics, don't bother
test -x $DAEMON || exit 0
test -f $DEFAULT && . $DEFAULT
if [ "x$start_boot" != "xtrue" ] ; then
exit 0
fi
if [ ! -e $MONO_SHARED_DIR ]; then
mkdir $MONO_SHARED_DIR
chown $user:$group $MONO_SHARED_DIR
fi
should_start() {
if [ ! -e $VIRTUALFILE -o `cat $VIRTUALFILE | wc -l` = "2" ]; then
log_action_msg "You have an incomplete $VIRTUALFILE"
log_action_msg "To fix it, you need to install at least one package for xsp2 (like asp.net2-examples)"
return 1
fi
if [ -f /var/run/$NAME.pid ]; then
# Are we really running xsp2?
xsp2_pid=`cat /var/run/$NAME.pid`
xsp2_ps=`ps -p $xsp2_pid | wc -l`
if [ "$xsp2_ps" != "1" ]; then
log_action_msg "Sorry, there is already a xsp2 running, stop it first"
return 1
fi
fi
return 0
}
case "$1" in
start)
if should_start ; then
log_daemon_msg "Starting $DESC" "$NAME"
export MONO_SHARED_DIR
start-stop-daemon --start --background --make-pidfile \
--quiet --pidfile /var/run/$NAME.pid \
--user $user --group $group --chuid $user \
--exec $DAEMON -- \
--port $port --address $address --appconfigdir \
$CFGDIR --nonstop
log_end_msg $?
fi
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
for i in $(ps aux | grep -v grep | grep 'xsp2.exe' | cut -c 10-15)
do
kill $i > /dev/null 2>&1
done
log_end_msg $?
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
|