Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 1e5cec07ba0c05d237a63d7f9804d819 > files > 4

lighttpd-1.4.28-6.2.mga1.src.rpm

#!/bin/sh
#
# lighttpd     Startup script for the lighttpd server
#
# chkconfig: 345 92 8
# description: Lightning fast webserver with light system requirements
#
# processname: lighttpd
# config: /etc/sysconfig/lighttpd
# config: /etc/lighttpd/lighttpd.conf
# pidfile: /var/run/lighttpd.pid

. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/lighttpd ]; then
	. /etc/sysconfig/lighttpd
fi

if [ -z "$LIGHTTPD_CONF_PATH" ]; then
	LIGHTTPD_CONF_PATH="/etc/lighttpd/lighttpd.conf"
fi

prog="lighttpd"
lighttpd="/usr/sbin/lighttpd"
RETVAL=0

start() {
	gprintf "Starting %s: " $prog
	daemon $lighttpd -f $LIGHTTPD_CONF_PATH
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
	return $RETVAL
}

stop() {
	gprintf "Stopping %s: " $prog
	killproc $lighttpd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
	return $RETVAL
}

reload() {
	gprintf "Reloading %s: " $prog
	killproc $lighttpd -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 $lighttpd
		RETVAL=$?
		;;
	*)
		gprintf "Usage: %s {start|stop|restart|condrestart|reload|status}" $0
		RETVAL=1
esac

exit $RETVAL