diff options
author | mm <mm@FreeBSD.org> | 2012-06-16 17:15:26 +0800 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2012-06-16 17:15:26 +0800 |
commit | 771311ed485c38c4187183af6577289257150d7c (patch) | |
tree | aef64731db2ea05e3d1892368feaa2433ab6e5c1 /www/lighttpd | |
parent | 687931b0736456c2c080b6d8c2bab7cb5770b5b2 (diff) | |
download | freebsd-ports-gnome-771311ed485c38c4187183af6577289257150d7c.tar.gz freebsd-ports-gnome-771311ed485c38c4187183af6577289257150d7c.tar.zst freebsd-ports-gnome-771311ed485c38c4187183af6577289257150d7c.zip |
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")
Diffstat (limited to 'www/lighttpd')
-rw-r--r-- | www/lighttpd/Makefile | 1 | ||||
-rw-r--r-- | www/lighttpd/files/lighttpd.sh.in | 44 |
2 files changed, 22 insertions, 23 deletions
diff --git a/www/lighttpd/Makefile b/www/lighttpd/Makefile index a63e86bf8f8f..9304a9a2bf75 100644 --- a/www/lighttpd/Makefile +++ b/www/lighttpd/Makefile @@ -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/ diff --git a/www/lighttpd/files/lighttpd.sh.in b/www/lighttpd/files/lighttpd.sh.in index aa86640603c1..3c8c37b0a227 100644 --- a/www/lighttpd/files/lighttpd.sh.in +++ b/www/lighttpd/files/lighttpd.sh.in @@ -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() -{ - rm -f ${pidfile} -} - -reload_precmd() +lighttpd_gracefulstop() { - if checkconfig; then - echo "Performing a graceful restart" - else - return 1 - fi + echo "Stopping ${name} gracefully." + sig_reload="INT" + run_rc_command reload } -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 |