Reply
Thread Tools
cddiede's Avatar
Posts: 1,034 | Thanked: 784 times | Joined on Dec 2007 @ Annapolis, MD
#11
Originally Posted by dvergin View Post
Thanks for the help. I've been trying to get this to work throught the init process for days.

I rebooted, and (happy day) lighttpd was running. Cheers, all.
If my post was of any help, then by all means, click the "Thanks" button.

If I get 75 thanks, I get a free cookie.
 
Posts: 200 | Thanked: 300 times | Joined on Nov 2009 @ The Netherlands
#12
I hope somebody has the answer to this problem...

The whole idea for running a webserver is to control functions on my phone (like making a phone call, get current battery status, shut it down or reboot it, send a SMS etc. etc. with the use of Python).

I am writing a web interface for all these things, but after boot up or reboot the webserver should automaticly come online...
 
Posts: 162 | Thanked: 351 times | Joined on Apr 2006 @ Cotswolds, UK
#13
Originally Posted by digitalvoid View Post
It will however after I manually do:

Code:
start lighttpd
I am not an expert on upstart but I have battled through a couple of unexpected behaviours...

If it starts OK using "start lighttpd" then maybe the trigger is causing the problem. Maybe, on your system rcS doesn't finish (or doesn't finish properly, or something)? Try replacing the

Code:
start on stopped rcS
with something else. I suggest trying some of the following...

Code:
start on MOUNTS_OK
Code:
start on started hildon-desktop
Code:
start on starting rcS
Although, if that is the problem, you have other problems as a number of other servers also try to start on "stopped rcS"!

If that is not the problem, the other possibility is that the environment is wrong, somehow. See if you can get any useful error messages by replacing the "exec..." command with a "script" containing something like this (not tested, sorry):

Code:
script
 echo "Trying to start lighttpd at `date`" >/tmp/lighttpd.log
 /usr/sbin/lighttpd -f /etc/lighttpd.conf >>/tmp/lighttpd.log 2>&1
end script
The look at /tmp/lighttpd.log after rebooting to see if it has any useful hints.
 

The Following User Says Thank You to Graham Cobb For This Useful Post:
Posts: 200 | Thanked: 300 times | Joined on Nov 2009 @ The Netherlands
#14
Thanks for all the help!

I finally solved my problem, this is my upstart script:

Code:
description "lighttpd - a lightweight web server"

start on started wlancond
stop on starting shutdown

console output

script
    while [ ! -e /home/user/MyDocs/web ]; do
        sleep 5
    done

    echo "Starting lighttpd (`date`)..." > /tmp/lighttpd.log

    /usr/sbin/lighttpd -f /etc/lighttpd.conf >> /tmp/lighttpd.log 2>&1
end script
My document-root of the web server was not ready mounted when it started up, so first there is a check before it starts lighttpd...
 

The Following User Says Thank You to digitalvoid For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 08:25.