14 Jun 20:03
Start up script for lighttpd?
From: Jack L <jlist9 <at> yahoo.ca>
Subject: Start up script for lighttpd?
Newsgroups: gmane.comp.web.lighttpd
Date: 2008-06-14 18:06:04 GMT
Subject: Start up script for lighttpd?
Newsgroups: gmane.comp.web.lighttpd
Date: 2008-06-14 18:06:04 GMT
Hi all,
I'm so not good at Unix stuff - a while ago I got a copy of the
/etc/init.d/lighttpd from someone on this list but I lost it.
I tried modifying from another file myself. Somehow it doesn't
start the back end process (Python FCGI) properly. The Python
back-end somehow can not find some modules. But if I run the
same command /usr/local/sbin/lighttpd -f /etc/lighttpd.conf,
it works just fine.
Can anyone help point out what I'm doing wrong? Below is the file.
--
Best regards,
Jack
#!/bin/sh
#
# chkconfig: - 85 15
# description: Startup script for the lighttpd server
#
# processname: lighttpd
# config: /etc/lighttpd.conf
# pidfile: /var/run/lighttpd.pid
# Source function library
.. /etc/rc.d/init.d/functions
appname="lighttpd"
pid="/var/run/$appname.pid"
socket="/tmp/$appname.socket"
RETVAL=0
start() {
echo -n $"Starting $prog: "
$appname -f /etc/lighttpd.conf
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
#killproc -p $pid
pkill lighttpd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
reload() {
echo -n $"Reloading $prog: "
killproc -p $pid -HUP
RETVAL=$?
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/$prog ]; then
stop
start
fi
;;
reload)
reload
;;
status)
status -p $pid
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
RETVAL=1
esac
exit $RETVAL
RSS Feed