From e2377f6ffad7784478e3b23a06c23d95ca38501c Mon Sep 17 00:00:00 2001 From: ganbold Date: Sat, 9 Apr 2016 08:19:15 +0000 Subject: Add configtest support for php-fpm rc script. PR: 208325 Submitted by: ganbold Approved by: miwi Sponsored by: A-Team Systems --- lang/php70/files/php-fpm.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lang') diff --git a/lang/php70/files/php-fpm.in b/lang/php70/files/php-fpm.in index 55e2ac992408..dfd243f88fad 100644 --- a/lang/php70/files/php-fpm.in +++ b/lang/php70/files/php-fpm.in @@ -17,11 +17,16 @@ name="php_fpm" rcvar=php_fpm_enable +start_precmd="php_fpm_checkconfig" +restart_precmd="php_fpm_checkconfig" +reload_precmd="php_fpm_checkconfig" +configtest_cmd="php_fpm_checkconfig" + load_rc_config "$name" : ${php_fpm_enable="NO"} -extra_commands="reload logrotate" +extra_commands="reload configtest logrotate" command="%%PREFIX%%/sbin/php-fpm" pidfile="/var/run/php-fpm.pid" @@ -40,4 +45,10 @@ php_fpm_logrotate() { kill -USR1 $rc_pid } +php_fpm_checkconfig() +{ + echo "Performing sanity check on php-fpm configuration:" + eval ${command} -t +} + run_rc_command "$1" -- cgit