#!/bin/sh # lighttpd # Source functions library source /etc/rc.d/init.d/functions log_script_name "$0 $*" # Check for missing binaries (stale symlinks should not happen) LIGHTTPD_BIN=/usr/sbin/lighttpd if [ ! -x ${LIGHTTPD_BIN} ]; then log_message "*** ERROR: ${LIGHTTPD_BIN} program not found." exit ${EXIT_CODE_FAILURE} fi # Check for existence of needed config file and read it LIGHTTPD_CONFIG=/etc/sysconfig/lighttpd if [ ! -r ${LIGHTTPD_CONFIG} ]; then log_message "*** ERROR: ${LIGHTTPD_CONFIG} not found." exit ${EXIT_CODE_FAILURE} fi . $LIGHTTPD_CONFIG case "$1" in start) cmd_run_log_box "Starting Lighttpd server" \ ${LIGHTTPD_BIN} -f ${LIGHTTPD_CONF_PATH} ;; stop) cmd_run_log_box "Stopping Lighttpd server" killproc ${LIGHTTPD_BIN} ;; restart) $0 stop sleep 1 $0 start ;; status) statusproc ${LIGHTTPD_BIN} ;; *) echo "Usage: $0 {start|stop|restart|status}" exit ${EXIT_CODE_FAILURE} ;; esac exit $?