WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Starting Lighttpd with bootlocal.sh  (Read 2425 times)

Offline angryjack

  • Newbie
  • *
  • Posts: 22
Starting Lighttpd with bootlocal.sh
« on: September 04, 2015, 07:25:09 AM »
Hello,

i have a problem loading lighttpd with bootlocal.sh. I did add the following line but the server won't start at boot:

Code: [Select]
sudo lighttpd -m /usr/local/lib/lighttpd -f /home/tc/lighttpd.conf
If i do execute the line manually the server does start. What can i do ?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Starting Lighttpd with bootlocal.sh
« Reply #1 on: September 04, 2015, 07:30:30 AM »
Hi angryjack
I'm guessing your network card isn't up yet. Are you running a GUI?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: Starting Lighttpd with bootlocal.sh
« Reply #2 on: September 04, 2015, 07:33:36 AM »
Also, don't use sudo, bootlocal.sh runs as root.
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Starting Lighttpd with bootlocal.sh
« Reply #3 on: September 04, 2015, 07:59:38 AM »
Hi angryjack
If you are running a GUI, the simplest fix is to create a file in the  .X.d  directory containing:
Code: [Select]
sudo lighttpd -m /usr/local/lib/lighttpd -f /home/tc/lighttpd.conf &It will be run automatically once X is up.
If you are not running a GUI, place the following in bootlocal.sh:
Code: [Select]
SEC=60
while [ $SEC -gt 0 ] ; do
   ifconfig | grep "inet addr:" | grep -qv "127.0.0.1" && break
   sleep 1
done
lighttpd -m /usr/local/lib/lighttpd -f /home/tc/lighttpd.conf

Offline angryjack

  • Newbie
  • *
  • Posts: 22
Re: Starting Lighttpd with bootlocal.sh
« Reply #4 on: September 04, 2015, 12:36:36 PM »
I do run PiCore on a RPi2 without GUI. Will try the script on monday. Thank you!
« Last Edit: September 04, 2015, 12:39:48 PM by angryjack »

Offline angryjack

  • Newbie
  • *
  • Posts: 22
[Solved] Starting Lighttpd with bootlocal.sh
« Reply #5 on: September 07, 2015, 12:36:12 AM »
Hello,

with the script it did also not work but it is running now.

The reason why it was not working was that i tried to start Lighttpd after Inetd. I placed the line before inetd and now it runs  ;)

Here is my bootlocal.sh
Code: [Select]
#!/bin/sh

# Start serial terminal
/usr/sbin/startserialtty &

# Set CPU frequency governor to ondemand (default is performance)
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# Load modules
/sbin/modprobe i2c-dev

# Start openssh daemon
/usr/local/etc/init.d/openssh start

# Start Webserver
lighttpd -m /usr/local/lib/lighttpd -f /home/tc/lighttpd.conf

# Start Inetd
/usr/local/sbin/inetd -d /etc/inetd.conf



# ------ Put other system startup commands below this line

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Starting Lighttpd with bootlocal.sh
« Reply #6 on: September 07, 2015, 08:46:27 AM »
lighttpd has a startup script in /usr/local/etc/init.d.  Why are you not using it?