diff options
author | Koop Mast <koop@beyonit.nl> | 2019-09-25 01:10:20 +0800 |
---|---|---|
committer | Koop Mast <koop@beyonit.nl> | 2019-09-25 01:10:20 +0800 |
commit | c5d4cd5d5cbcd9f16aa5bd8e5fcfdc96e17a81f6 (patch) | |
tree | 4b5a3cd1d243ff0c74465ea743ec310199c5edb5 /lang/php74/files/php-fpm.in | |
parent | fe87ebd172e9d689d85015844fb5a85fb32b3e50 (diff) | |
parent | 54294ad9726b349cbad4ebbbe9711550f8b1e53d (diff) | |
download | freebsd-ports-gnome-c5d4cd5d5cbcd9f16aa5bd8e5fcfdc96e17a81f6.tar.gz freebsd-ports-gnome-c5d4cd5d5cbcd9f16aa5bd8e5fcfdc96e17a81f6.tar.zst freebsd-ports-gnome-c5d4cd5d5cbcd9f16aa5bd8e5fcfdc96e17a81f6.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'lang/php74/files/php-fpm.in')
-rw-r--r-- | lang/php74/files/php-fpm.in | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/lang/php74/files/php-fpm.in b/lang/php74/files/php-fpm.in new file mode 100644 index 000000000000..1c9d7f5c81ba --- /dev/null +++ b/lang/php74/files/php-fpm.in @@ -0,0 +1,69 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: php-fpm +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable php-fpm: +# php_fpm_enable="YES" +# + +. /etc/rc.subr + +name="php_fpm" +rcvar=php_fpm_enable + +start_precmd="php_fpm_prestart" +restart_precmd="php_fpm_checkconfig" +reload_precmd="php_fpm_checkconfig" +configtest_cmd="php_fpm_checkconfig" + +load_rc_config "$name" + +: ${php_fpm_enable="NO"} +: ${php_fpm_umask=""} + +extra_commands="reload configtest logrotate" + +command="%%PREFIX%%/sbin/php-fpm" +pidfile="/var/run/php-fpm.pid" +sig_stop="QUIT" +sig_reload="USR2" +logrotate_cmd="php_fpm_logrotate" + +required_files="%%PREFIX%%/etc/php-fpm.conf" + +php_fpm_logrotate() { + if [ -z "$rc_pid" ]; then + _run_rc_notrunning + return 1 + fi + echo "Rotating logs $name." + kill -USR1 $rc_pid +} + +php_fpm_checkconfig() +{ + echo "Performing sanity check on php-fpm configuration:" + eval ${command} -t +} + +php_fpm_prestart() +{ + php_fpm_checkconfig + checkconfig=$? + if [ $checkconfig -ne 0 ]; then + return $checkconfig + fi + + if [ ! -z "$php_fpm_umask" ]; then + echo "Setting umask to: ${php_fpm_umask}" + umask $php_fpm_umask + fi +} + +run_rc_command "$1" |