LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-16-2011, 11:03 AM   #1
ted_chou12
Member
 
Registered: Aug 2010
Location: Zhongli, Taoyuan
Distribution: slackware, windows, debian (armv4l GNU/Linux)
Posts: 425
Blog Entries: 28

Rep: Reputation: 2
initiation script terminates webpage


Hi, I have a lighttpd server startup script (default):
Code:
#!/bin/sh
### BEGIN INIT INFO
# Provides:          lighttpd
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs $network
# Should-Start:      fam
# Should-Stop:       fam
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start the lighttpd web server.
### END INIT INFO


PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/lighttpd
NAME=lighttpd
DESC="web server"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

DAEMON_OPTS="-f /etc/lighttpd/lighttpd.conf"

test -x $DAEMON || exit 0

set -e

# be sure there is a /var/run/lighttpd, even with tmpfs
mkdir -p /var/run/lighttpd > /dev/null 2> /dev/null
chown www-data:www-data /var/run/lighttpd
chmod 0750 /var/run/lighttpd

. /lib/lsb/init-functions

case "$1" in
    start)
        log_daemon_msg "Starting $DESC" $NAME
        if ! start-stop-daemon --start --quiet --oknodo \
            --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
        then
            log_end_msg 1
        else
            log_end_msg 0
        fi
        ;;
    stop)
        log_daemon_msg "Stopping $DESC" $NAME
        if start-stop-daemon --quiet --stop --oknodo --retry 30 --oknodo \
            --pidfile $PIDFILE --exec $DAEMON
        then
            rm -f $PIDFILE
            log_end_msg 0
        else
            log_end_msg 1
        fi
        ;;
    reload)
        log_daemon_msg "Reloading $DESC configuration" $NAME
        if start-stop-daemon --stop --signal 2 --oknodo --retry 30 --oknodo \
            --quiet --pidfile $PIDFILE --exec $DAEMON
        then
            if start-stop-daemon --start --quiet  \
                --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS ; then
                log_end_msg 0
            else
                log_end_msg 1
            fi
        else
            log_end_msg 1
        fi
        ;;
    restart|force-reload)
        $0 stop
        test -r  $PIDFILE && while pidof lighttpd | \
            grep -q `cat $PIDFILE 2>/dev/null` 2>/dev/null ; do sleep 1; done
        $0 start
        ;;
    *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
        exit 1
        ;;
esac

exit 0
And I wish to run this script through a manager on gui, but i dont know why the gui webpage terminates with only messages like
Quote:
Stopping web server: lighttpd. Starting web server: lighttpd.
And the footer of the page is not loaded, I guess the init.d script died the message, causing page not to finish loading:
here is what I placed in page for example
Code:
 	Start)
      	/etc/init.d/lighttpd start
      	sleep 2
    	;;
how would i edit the init.d script so the web page finishes loading?
Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script terminates as zombie, ie, <defunct> Kropotkin Linux - Newbie 3 02-20-2007 12:15 AM
How do I keep an executable from terminates after the initiating shell terminates mr.v. Linux - Newbie 8 01-20-2007 02:47 AM
Outputting information from my script to a webpage circuit_girl Programming 3 09-28-2006 02:59 PM
script to download a webpage pankaj99 Programming 4 09-23-2006 06:28 AM
script to update my webpage yank_ Linux - General 0 02-16-2001 05:56 PM


All times are GMT -5. The time now is 03:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration