WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline angryjack

  • Newbie
  • *
  • Posts: 22
Starting Lighttpd with bootlocal.sh
« on: September 04, 2015, 10: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 ?

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11315
Re: Starting Lighttpd with bootlocal.sh
« Reply #1 on: September 04, 2015, 10: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: 10992
Re: Starting Lighttpd with bootlocal.sh
« Reply #2 on: September 04, 2015, 10: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.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11315
Re: Starting Lighttpd with bootlocal.sh
« Reply #3 on: September 04, 2015, 10: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, 03: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, 03:39:48 PM by angryjack »

Offline angryjack

  • Newbie
  • *
  • Posts: 22
[Solved] Starting Lighttpd with bootlocal.sh
« Reply #5 on: September 07, 2015, 03: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, 11:46:27 AM »
lighttpd has a startup script in /usr/local/etc/init.d.  Why are you not using it?