Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jun 2017 09:40:58 +0000 (UTC)
From:      Torsten Zuehlsdorff <tz@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r444558 - in head/lang: php70/files php71/files
Message-ID:  <201706280940.v5S9ewuR026596@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tz
Date: Wed Jun 28 09:40:58 2017
New Revision: 444558
URL: https://svnweb.freebsd.org/changeset/ports/444558

Log:
  lang/php70 and lang/php71: Add umask to php-fpm rc script
  
  PR:           212911
  Submitted by: Robert Kánia <rk@redb.cz>

Modified:
  head/lang/php70/files/php-fpm.in
  head/lang/php71/files/php-fpm.in

Modified: head/lang/php70/files/php-fpm.in
==============================================================================
--- head/lang/php70/files/php-fpm.in	Wed Jun 28 09:18:33 2017	(r444557)
+++ head/lang/php70/files/php-fpm.in	Wed Jun 28 09:40:58 2017	(r444558)
@@ -17,7 +17,7 @@
 name="php_fpm"
 rcvar=php_fpm_enable
 
-start_precmd="php_fpm_checkconfig"
+start_precmd="php_fpm_prestart"
 restart_precmd="php_fpm_checkconfig"
 reload_precmd="php_fpm_checkconfig"
 configtest_cmd="php_fpm_checkconfig"
@@ -25,6 +25,7 @@ configtest_cmd="php_fpm_checkconfig"
 load_rc_config "$name"
 
 : ${php_fpm_enable="NO"}
+: ${php_fpm_umask=""}
 
 extra_commands="reload configtest logrotate"
 
@@ -49,6 +50,20 @@ 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"

Modified: head/lang/php71/files/php-fpm.in
==============================================================================
--- head/lang/php71/files/php-fpm.in	Wed Jun 28 09:18:33 2017	(r444557)
+++ head/lang/php71/files/php-fpm.in	Wed Jun 28 09:40:58 2017	(r444558)
@@ -17,7 +17,7 @@
 name="php_fpm"
 rcvar=php_fpm_enable
 
-start_precmd="php_fpm_checkconfig"
+start_precmd="php_fpm_prestart"
 restart_precmd="php_fpm_checkconfig"
 reload_precmd="php_fpm_checkconfig"
 configtest_cmd="php_fpm_checkconfig"
@@ -25,6 +25,7 @@ configtest_cmd="php_fpm_checkconfig"
 load_rc_config "$name"
 
 : ${php_fpm_enable="NO"}
+: ${php_fpm_umask=""}
 
 extra_commands="reload configtest logrotate"
 
@@ -49,6 +50,20 @@ 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706280940.v5S9ewuR026596>