diff options
author | Juergen Beisert <j.beisert@pengutronix.de> | 2007-02-27 17:54:37 +0000 |
---|---|---|
committer | Juergen Beisert <j.beisert@pengutronix.de> | 2007-02-27 17:54:37 +0000 |
commit | 8e77a937fcf891b880ff6dd699829edbb8d96ef6 (patch) | |
tree | 811b8e868980f7bd825dda02b14548002fe0ac2c /generic | |
parent | 2f7b3f9d4f8fe04199f09e84a430b16ade105b85 (diff) | |
download | ptxdist-8e77a937fcf891b880ff6dd699829edbb8d96ef6.tar.gz ptxdist-8e77a937fcf891b880ff6dd699829edbb8d96ef6.tar.xz |
* thttpd: adding open issue to the TODO list
- fixing error message, when the service is not running and
should be stopped
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@7019 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'generic')
-rwxr-xr-x | generic/etc/init.d/thttpd | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/generic/etc/init.d/thttpd b/generic/etc/init.d/thttpd index 1e3576e27..51102b9d0 100755 --- a/generic/etc/init.d/thttpd +++ b/generic/etc/init.d/thttpd @@ -9,34 +9,38 @@ DOCUMENTROOT="/var/www" thttpd="/usr/sbin/thttpd" PIDFILE="/var/run/thttpd.pid" LOGFILE="/var/log/thttpd.log" - + usage() { echo "${PREFIX}usage: $THISFILE [start|stop]" } -case $1 in +case $1 in start) echo "${PREFIX} starting" - if [ -e "$PIDFILE" ]; then + if [ -e "$PIDFILE" ]; then echo "${PREFIX} warning: another thttpd seems to be running, trying to kill it" kill -9 `cat $PIDFILE` rm -f $PIDFILE fi $thttpd -d $DOCUMENTROOT -u www -nor -nos -p 80 -c '**.cgi' -i $PIDFILE -l $LOGFILE - if [ "$?" != "0" ]; then + if [ "$?" != "0" ]; then echo "${PREFIX} error, could not start server" rm -f $PIDFILE - else + else echo "${PREFIX} done" fi ;; stop) - echo "${PREFIX} stopping" - kill -USR1 `cat $PIDFILE` - rm -f $PIDFILE - echo "${PREFIX} done" + if [ -e "$PIDFILE" ]; then + echo "${PREFIX} stopping" + kill -USR1 `cat $PIDFILE` + rm -f $PIDFILE + echo "${PREFIX} done" + else + echo "${PREFIX} not running" + fi ;; *) @@ -46,4 +50,3 @@ case $1 in ;; esac - |