1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

Alter lighttpd startup script subcommands to behave like the apache script:

"reload" now sends a SIGHUP and cycles logfiles
"graceful" now performs a graceful restart
"gracefulstop" now performs a graceful stp
"configtest" now checks the configuration file for correct syntax

Removed subcommand:
"check" (replaced by "configtest")
This commit is contained in:
Martin Matuska 2012-06-16 09:15:26 +00:00
parent c2e08fb4ba
commit 988359e810
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=299390
3 changed files with 33 additions and 23 deletions

View File

@ -5,6 +5,17 @@ they are unavoidable.
You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.
20120616:
AFFECTS: users of www/lighttpd
AUTHOR: mm@FreeBSD.org
The lighttpd startup script has been changed and is now compatible to the
apache startup script. The "reload" subcommand now sends a SIGHUP to the
process and triggers cycling of log files. The new command "graceful"
performs a graceful restart (similiar to former "reload") and "gracefulstop"
performs a graceful stop. The "check" command has been replaced with
the "configtest" command.
20120615:
AFFECTS: users of databases/akonadi
AUTHOR: kde@FreeBSD.org

View File

@ -7,6 +7,7 @@
PORTNAME?= lighttpd
PORTVERSION= 1.4.31
PORTREVISION= 1
CATEGORIES?= www
MASTER_SITES?= http://download.lighttpd.net/lighttpd/releases-1.4.x/

View File

@ -49,17 +49,16 @@ fi
command=%%PREFIX%%/sbin/lighttpd
stop_postcmd=stop_postcmd
restart_precmd="checkconfig"
reload_precmd=reload_precmd
reload_postcmd=reload_postcmd
sig_reload="INT"
check_cmd="checkconfig"
extra_commands="reload check"
restart_precmd="lighttpd_checkconfig"
graceful_cmd="lighttpd_graceful"
gracefulstop_cmd="lighttpd_gracefulstop"
configtest_cmd="lighttpd_checkconfig"
extra_commands="reload graceful gracefulstop configtest"
command_args="-f ${lighttpd_conf}"
pidfile=${lighttpd_pidfile}
required_files=${lighttpd_conf}
check_deprecated()
lighttpd_check_deprecated()
{
if [ -n "${deprecated_conf}" ]; then
echo ""
@ -70,33 +69,27 @@ check_deprecated()
fi
}
checkconfig()
lighttpd_checkconfig()
{
echo "Performing sanity check on ${name} configuration:"
eval "${command} ${command_args} -t"
}
stop_postcmd()
lighttpd_gracefulstop()
{
rm -f ${pidfile}
echo "Stopping ${name} gracefully."
sig_reload="INT"
run_rc_command reload
}
reload_precmd()
{
if checkconfig; then
echo "Performing a graceful restart"
else
return 1
fi
}
reload_postcmd()
lighttpd_graceful()
{
lighttpd_gracefulstop
rm -f ${pidfile}
run_rc_command start
}
run_instance()
lighttpd_run_instance()
{
_i="$1"
_rcmd="$2"
@ -110,6 +103,11 @@ run_instance()
run_rc_command ${_rcmd}
}
stop_postcmd()
{
rm -f ${pidfile}
}
if [ -n "${lighttpd_instances}" ]; then
_orig_name="${name}"
_run_cmd="$1"
@ -131,9 +129,9 @@ if [ -n "${lighttpd_instances}" ]; then
_runlist="${lighttpd_instances}"
fi
for _in in ${_runlist}; do
run_instance $_in $_run_cmd
lighttpd_run_instance $_in $_run_cmd
done
else
start_precmd="check_deprecated"
start_precmd="lighttpd_check_deprecated"
run_rc_command "$1"
fi