#15 thttpd beenden

closed-accepted
nobody
None
5
2010-10-24
2010-09-25
amd-65
No

thttpd läßt sich per Script nicht beenden, da sich das Script selber killt.
[code]
Index: bs_extra/start_scripts/http.sh
===================================================================
--- bs_extra/start_scripts/http.sh (Revision 135)
+++ bs_extra/start_scripts/http.sh (Arbeitskopie)
@@ -4,24 +4,28 @@
#
#
PID="/var/run/thttpd.pid"
+HTTPRUN="/var/httprun.sh"

case "$1" in
start)
echo "Starting thttpd"
http_start=`/bin/nvram get http_start`
[ "$http_start" != "Failed" ] && [ "$http_start" != "1" ] && exit 0
-
+
port=`/bin/nvram get http_port`
[ "$port" = "Failed" ] && port=80
-
- while [ 1 -ne 2 ]; do
- /bin/thttpd -nos -p $port -d /webs -c '**.cgi' -l /dev/null -i $PID -u root -D
- done
+
+ echo "#!/bin/sh" >$HTTPRUN
+ echo "while [ 1 -ne 2 ]; do" >>$HTTPRUN
+ echo " /bin/thttpd -nos -p $port -d /webs -c '**.cgi' -l /dev/null -i $PID -u root -D" >>$HTTPRUN
+ echo "done" >>$HTTPRUN
+ chmod +x $HTTPRUN
+ $HTTPRUN &>/dev/null 2>/dev/null
;;
stop)
echo "Stopping thttpd"
- killall http.sh >/dev/null 2>/dev/null
- killall -9 http.sh >/dev/null 2>/dev/null
+ killall httprun.sh >/dev/null 2>/dev/null
+ killall -9 httprun.sh >/dev/null 2>/dev/null
kill `cat $PID` >/dev/null 2>/dev/null
kill -9 `cat $PID` >/dev/null 2>/dev/null
;;
[/code]

Discussion

  • Patrick Schmidt

    Patrick Schmidt - 2010-10-24
    • status: open --> closed-accepted
     
  • Patrick Schmidt

    Patrick Schmidt - 2010-10-24

    Danke! Habs getestet und funktioniert wunderbar...

     

Log in to post a comment.