Permalink
Browse files

added debian startup script

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@982 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent c15e16a commit 701732a22508b3fac8258b447fedb2d3e33dc9c2 @klacke committed Jun 16, 2006
Showing with 51 additions and 0 deletions.
  1. +7 −0 scripts/Install
  2. +44 −0 scripts/debian/yaws.init.d
View
@@ -53,6 +53,13 @@ elif [ -f /etc/suseservers ]; then
chmod +x ${destdir}/${etcdir}/init.d/yaws
install -d ${destdir}/${vardir}/run/yaws
chmod a+rwx ${destdir}/${vardir}/run/yaws
+elif [ -f /etc/debian_version ]; then
+ install -d ${destdir}/${etcdir}/init.d
+ sed -e "s;%prefix%;$p;g" debian/yaws.init.d > ${destdir}/${etcdir}/init.d/yaws
+ chmod +x ${destdir}/${etcdir}/init.d/yaws
+ install -d ${destdir}/${vardir}/run/yaws
+ chmod a+rwx ${destdir}/${vardir}/run/yaws
+
elif [ "`uname -s`" = "Darwin" && `id -u` = 0 ]; then
startupdir="/Library/StartupItems/Yaws"
if [ ! -d ${startupdir} && ]; then
View
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# Startup script for the Yaws Web Server
+#
+# config: /etc/yaws.conf
+#
+
+
+
+
+yaws=%prefix%/bin/yaws
+prog=yaws
+yawsid=myserverid
+
+test -x $yaws || exit 1
+
+
+case "$1" in
+ start)
+ echo -n "Starting $prog: "
+ start-stop-daemon --start --quiet --exec $yaws -- --id ${yawsid} --daemon --heart
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping $prog: "
+ start-stop-daemon --stop --quiet --exec $yaws --id ${yawsid} --stop
+ echo "."
+ ;;
+ reload)
+ echo -n "Reloading $prog: "
+ start-stop-daemon --exec $yaws --id ${yawsid} --hup
+ echo "."
+ ;;
+ status)
+ start-stop-daemon --exec $yaws --id ${yawsid} --status
+ echo "."
+ ;;
+ *)
+ echo $"Usage: $prog {start|stop|restart|reload|status}"
+ exit 1
+esac
+
+exit 0
+

0 comments on commit 701732a

Please sign in to comment.