Tiny Core Linux
General TC => General TC Talk => Topic started by: angryjack 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:
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 ?
-
Hi angryjack
I'm guessing your network card isn't up yet. Are you running a GUI?
-
Also, don't use sudo, bootlocal.sh runs as root.
-
Hi angryjack
If you are running a GUI, the simplest fix is to create a file in the .X.d directory containing:
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:
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
-
I do run PiCore on a RPi2 without GUI. Will try the script on monday. Thank you!
-
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
#!/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
-
lighttpd has a startup script in /usr/local/etc/init.d. Why are you not using it?