[Pkg-mono-svn-commits] rev 526 - xsp-snapshot/trunk/debian/official
Pablo Fischer
pabl0-guest@haydn.debian.org
Fri, 09 Apr 2004 16:55:24 -0600
Author: pabl0-guest
Date: 2004-04-09 16:55:21 -0600 (Fri, 09 Apr 2004)
New Revision: 526
Modified:
xsp-snapshot/trunk/debian/official/mono-server.init
xsp-snapshot/trunk/debian/official/mono-xsp.init
Log:
Removed the should_restart and now should_Start and should_stop return
a true or false, so the output is cleaner
Modified: xsp-snapshot/trunk/debian/official/mono-server.init
===================================================================
--- xsp-snapshot/trunk/debian/official/mono-server.init 2004-04-09 22:48:33 UTC (rev 525)
+++ xsp-snapshot/trunk/debian/official/mono-server.init 2004-04-09 22:55:21 UTC (rev 526)
@@ -39,37 +39,38 @@
. $DEFAULT
if [ "$start_boot" != "true" ]; then
echo "$NAME not started as requested"
- exit 0
+ return 1
fi
fi
if [ ! -f /usr/lib/apache/1.3/500mod_mono.info ]; then
echo "There's no need to start me if you don't have libapache-mod-mono, sorry!"
- exit 0
+ return 1
fi
if [ ! -x $DAEMON ]; then
echo "$NAME is not executable, not starting"
- exit 0
+ return 1
fi
if [ ! -e $VIRTUALFILE ]; then
echo "You dont have $VIRTUALFILE "
echo "To have it, you need to install at least one package for xsp (like asp.net-examples)"
- exit 0
+ return 1
fi
if [[ $virtual_dirs = *Sorry* ]]; then
echo "Sorry, I found a missconfiguration in /etc/mono-server/mono-server-hosts.conf, fix it, or dpkg-reconfigure mono-server/virtua\lhosts packages"
- exit 0
+ return 1
fi
if [[ -z $virtual_dirs ]]; then
echo "Sorry, I found an empty /etc/mono-server/mono-server-hosts.conf"
- exit 0
+ return 1
fi
prepare_socket
+ return 0
}
@@ -79,59 +80,37 @@
monoserver_pid=`cat /var/run/$NAME`
monoserver_ps=`ps -p $monoserver_pid | wc -l`
# Are there any process running by that pid?
- if [ "$xsp_ps" = "2" ]; then
+ if [ "$monoserver_ps" = "2" ]; then
return 0
else
return 1
fi
+ else
+ return 0
fi
- if [ ! -f /var/run/$NAME ]; then
- echo "Sorry, mono-server is not running at the moment"
- exit 0
- else
- # Are we really running xsp?
- monoserver_pid=`cat /var/run/$NAME`
- monoserver_ps=`ps -p $monoserver_pid | wc -l`
- # Are there any process running by that pid?
- if [ "$monoserver_ps" = "1" ]; then
- echo "Sorry, mono-server is not running at the moment"
- exit 0
- fi
- fi
-}
-should_restart() {
- if [ -f /var/run/$NAME ]; then
- # Are we really running monoserver?
- monoserver_pid=`cat /var/run/$NAME`
- monoserver_ps=`ps -p $monoserver_pid | wc -l`
- # Are there any process running by that pid?
- if [ "$monoserver_ps" = "2" ]; then
- return 0
- else
- return 1
- fi
- fi
}
case "$1" in
start)
- should_start
- . $DEFAULT
- echo -n "Starting $DESC: $NAME"
- start-stop-daemon --start --background --make-pidfile \
- --quiet --pidfile /var/run/$NAME \
- --exec $DAEMON -- --applications $virtual_dirs --filename $socket_file --nonstop
- echo "."
- sleep 2
- fix_privileges
+ if should_start ; then
+ . $DEFAULT
+ echo -n "Starting $DESC: $NAME"
+ start-stop-daemon --start --background --make-pidfile \
+ --quiet --pidfile /var/run/$NAME \
+ --exec $DAEMON -- --applications $virtual_dirs --filename $socket_file --nonstop
+ echo "."
+ sleep 2
+ fix_privileges
+ fi
;;
stop)
- should_stop
- echo -n "Stopping $DESC: $NAME "
- start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
- echo "."
+ if should_stop ; then
+ echo -n "Stopping $DESC: $NAME "
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
+ echo "."
+ fi
;;
restart|force-reload)
#
@@ -139,20 +118,21 @@
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
#
- if should_restart ; then
+ if should_stop ; then
echo "Restarting $DESC: $NAME"
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
sleep 1
fi
- should_start
- . $DEFAULT
- start-stop-daemon --start --background --make-pidfile \
- --quiet --pidfile /var/run/$NAME \
- --exec $DAEMON -- --applications $virtual_dirs --filename $socket_file --nonstop
- echo "."
- sleep 2
- fix_privileges
+ if should_start ; then
+ . $DEFAULT
+ start-stop-daemon --start --background --make-pidfile \
+ --quiet --pidfile /var/run/$NAME \
+ --exec $DAEMON -- --applications $virtual_dirs --filename $socket_file --nonstop
+ echo "."
+ sleep 2
+ fix_privileges
+ fi
;;
*)
N=/etc/init.d/$NAME
Modified: xsp-snapshot/trunk/debian/official/mono-xsp.init
===================================================================
--- xsp-snapshot/trunk/debian/official/mono-xsp.init 2004-04-09 22:48:33 UTC (rev 525)
+++ xsp-snapshot/trunk/debian/official/mono-xsp.init 2004-04-09 22:55:21 UTC (rev 526)
@@ -23,29 +23,29 @@
. $DEFAULT
if [ "$start_boot" != "true" ]; then
echo "$NAME not started as requested"
- exit 0
+ return 1
fi
fi
if [ ! -x $DAEMON ]; then
echo "$NAME is not executable, not starting"
- exit 0
+ return 1
fi
if [ ! -e $VIRTUALFILE ]; then
echo "You dont have $VIRTUALFILE "
echo "To have it, you need to install at least one package for xsp (like asp.net-examples)"
- exit 0
+ return 1
fi
if [[ $virtual_dirs = *Sorry* ]]; then
echo "Sorry, I found a missconfiguration in /etc/xsp/mono-xsp-hosts.conf, fix it, or dpkg-reconfigure mono-xsp/virtualhosts packages"
- exit 0
+ return 1
fi
if [[ -z $virtual_dirs ]]; then
echo "Sorry, I found an empty /etc/xsp/mono-xsp-hosts.conf"
- exit 0
+ return 1
fi
if [ -f /var/run/$NAME ]; then
@@ -54,29 +54,14 @@
xsp_ps=`ps -p $xsp_pid | wc -l`
if [ "$xsp_ps" != "1" ]; then
echo "Sorry, there is already a xsp running, stop it first"
- exit 0
+ return 1
fi
fi
+ return 0
}
should_stop() {
- if [ ! -f /var/run/$NAME ]; then
- echo "Sorry, mono-xsp is not running at the moment"
- exit 0
- else
- # Are we really running xsp?
- xsp_pid=`cat /var/run/$NAME`
- xsp_ps=`ps -p $xsp_pid | wc -l`
- # Are there any process running by that pid?
- if [ "$xsp_ps" = "1" ]; then
- echo "Sorry, mono-xsp is not running at the moment"
- exit 0
- fi
- fi
-}
-
-should_restart() {
if [ -f /var/run/$NAME ]; then
# Are we really running xsp?
xsp_pid=`cat /var/run/$NAME`
@@ -87,25 +72,29 @@
else
return 1
fi
- fi
+ else
+ return 0
+ fi
}
case "$1" in
start)
- should_start
- . $DEFAULT
- echo -n "Starting $DESC: $NAME"
- start-stop-daemon --start --background --make-pidfile \
- --quiet --pidfile /var/run/$NAME \
- --exec $DAEMON -- \
- --port $port --applications $virtual_dirs --nonstop
- echo "."
+ if should_start ; then
+ . $DEFAULT
+ echo -n "Starting $DESC: $NAME"
+ start-stop-daemon --start --background --make-pidfile \
+ --quiet --pidfile /var/run/$NAME \
+ --exec $DAEMON -- \
+ --port $port --applications $virtual_dirs --nonstop
+ echo "."
+ fi
;;
stop)
- should_stop
- echo -n "Stopping $DESC: $NAME "
- start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
- echo "."
+ if should_stop ; then
+ echo -n "Stopping $DESC: $NAME "
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
+ echo "."
+ fi
;;
restart|force-reload)
#
@@ -114,20 +103,21 @@
# just the same as "restart".
#
- if should_restart ; then
+ if should_stop ; then
echo "Restarting $DESC: $NAME"
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
sleep 1
fi
- should_start
- . $DEFAULT
- echo "Starting $DESC: $NAME"
- start-stop-daemon --start --background --make-pidfile \
- --quiet --pidfile /var/run/$NAME \
- --exec $DAEMON -- \
- --port $port --applications $virtual_dirs --nonstop
- echo "."
+ if should_start ; then
+ . $DEFAULT
+ echo "Starting $DESC: $NAME"
+ start-stop-daemon --start --background --make-pidfile \
+ --quiet --pidfile /var/run/$NAME \
+ --exec $DAEMON -- \
+ --port $port --applications $virtual_dirs --nonstop
+ echo "."
+ fi
;;
*)
N=/etc/init.d/$NAME