diff options
author | Antony Dovgal <tony2001@php.net> | 2009-12-15 13:15:05 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2009-12-15 13:15:05 +0000 |
commit | e1daaf5cd154e5e15b4ea1a27ac2b7ad38638218 (patch) | |
tree | 61e0cdcfcbf0ba9c8dce39349c2859c94b330e0b | |
parent | 30de645074a197642e21110ef9c56a573867d873 (diff) | |
download | php-git-e1daaf5cd154e5e15b4ea1a27ac2b7ad38638218.tar.gz |
use --localstatedir instead of separate options for pid and log files
-rw-r--r-- | sapi/fpm/Makefile.frag | 4 | ||||
-rw-r--r-- | sapi/fpm/config.m4 | 93 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_conf.c | 6 | ||||
-rw-r--r-- | sapi/fpm/php-fpm.conf.in | 6 |
4 files changed, 34 insertions, 75 deletions
diff --git a/sapi/fpm/Makefile.frag b/sapi/fpm/Makefile.frag index 1b3595c97c..a2fdae3864 100644 --- a/sapi/fpm/Makefile.frag +++ b/sapi/fpm/Makefile.frag @@ -10,8 +10,8 @@ install-build: install-fpm install-fpm: install-sapi @echo "Installing PHP FPM binary: $(INSTALL_ROOT)$(sbindir)/" @$(mkinstalldirs) $(INSTALL_ROOT)$(sbindir) - @$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_pid_dir) - @$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_log_dir) + @$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/log + @$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/run @$(INSTALL) -m 0755 $(SAPI_FPM_PATH) $(INSTALL_ROO)$(sbindir)/$(program_prefix)php-fpm$(program_suffix)$(EXEEXT) @echo "Installing PHP FPM config: $(INSTALL_ROOT)$(sysconfdir)/" && \ diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4 index 31c0a14d76..bf82da4973 100644 --- a/sapi/fpm/config.m4 +++ b/sapi/fpm/config.m4 @@ -215,14 +215,6 @@ fi dnl }}} dnl configure checks {{{ -AC_DEFUN([AC_FPM_CHECKS], -[ - AC_FPM_STDLIBS - AC_FPM_PRCTL - AC_FPM_CLOCK - AC_FPM_TRACE -]) - AC_DEFUN([AC_FPM_STDLIBS], [ AC_CHECK_FUNCS(setenv clearenv) @@ -506,14 +498,31 @@ AC_DEFUN([AC_FPM_TRACE], ]) dnl }}} -dnl configure options {{{ -AC_DEFUN([AC_FPM_ARGS], -[ - PHP_ARG_WITH(fpm-log,, - [ --with-fpm-log[=PATH] Set the path for php-fpm log file. (default: /var/log/php-fpm.log)], yes, no) +AC_MSG_CHECKING(for FPM build) +if test "$PHP_FPM" != "no"; then + AC_MSG_RESULT($PHP_FPM) + + AC_LIB_EVENT([$minimum_libevent_version]) + + AC_CACHE_CHECK(whether libevent build works, php_cv_libevent_build_works, [ + PHP_TEST_BUILD(event_init, + [ + php_cv_libevent_build_works=yes + ], [ + AC_MSG_RESULT(no) + AC_MSG_ERROR([build test failed. Please check the config.log for details.]) + ], $LIBEVENT_LIBS) + ]) - PHP_ARG_WITH(fpm-pid,, - [ --with-fpm-pid[=PATH] Set the path for php-fpm pid file. (default: /var/run/php-fpm.pid)], yes, no) + PHP_SETUP_LIBXML(FPM_SHARED_LIBADD, [ + ], [ + AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.]) + ]) + + AC_FPM_STDLIBS + AC_FPM_PRCTL + AC_FPM_CLOCK + AC_FPM_TRACE PHP_ARG_WITH(fpm-user,, [ --with-fpm-user[=USER] Set the user for php-fpm to run as. (default: nobody)], nobody, no) @@ -521,23 +530,6 @@ AC_DEFUN([AC_FPM_ARGS], PHP_ARG_WITH(fpm-group,, [ --with-fpm-group[=GRP] Set the group for php-fpm to run as. For a system user, this should usually be set to match the fpm username (default: nobody)], nobody, no) -]) - -AC_DEFUN([AC_FPM_VARS], -[ - if test -z "$PHP_FPM_LOG" -o "$PHP_FPM_LOG" = "yes" -o "$PHP_FPM_LOG" = "no"; then - php_fpm_log_path="/var/log/php-fpm.log" - else - php_fpm_log_path="$PHP_FPM_LOG" - fi - php_fpm_log_dir=`dirname $php_fpm_log_path` - - if test -z "$PHP_FPM_PID" -o "$PHP_FPM_PID" = "yes" -o "$PHP_FPM_PID" = "no"; then - php_fpm_pid_path="/var/run/php-fpm.pid" - else - php_fpm_pid_path="$PHP_FPM_PID" - fi - php_fpm_pid_dir=`dirname $php_fpm_pid_path` if test -z "$PHP_FPM_USER" -o "$PHP_FPM_USER" = "yes" -o "$PHP_FPM_USER" = "no"; then php_fpm_user="nobody" @@ -551,51 +543,14 @@ AC_DEFUN([AC_FPM_VARS], php_fpm_group="$PHP_FPM_GROUP" fi - PHP_SUBST_OLD(fpm_version) - PHP_SUBST_OLD(php_fpm_log_path) - PHP_SUBST_OLD(php_fpm_pid_path) - PHP_SUBST_OLD(php_fpm_log_dir) - PHP_SUBST_OLD(php_fpm_pid_dir) PHP_SUBST_OLD(php_fpm_user) PHP_SUBST_OLD(php_fpm_group) AC_DEFINE_UNQUOTED(PHP_FPM_VERSION, "$fpm_version", [fpm version]) - AC_DEFINE_UNQUOTED(PHP_FPM_LOG_PATH, "$php_fpm_log_path", [fpm log file path]) - AC_DEFINE_UNQUOTED(PHP_FPM_PID_PATH, "$php_fpm_pid_path", [fpm pid file path]) AC_DEFINE_UNQUOTED(PHP_FPM_USER, "$php_fpm_user", [fpm user name]) AC_DEFINE_UNQUOTED(PHP_FPM_GROUP, "$php_fpm_group", [fpm group name]) -]) - -dnl }}} - - -AC_MSG_CHECKING(for FPM build) -if test "$PHP_FPM" != "no"; then - AC_MSG_RESULT($PHP_FPM) - - AC_LIB_EVENT([$minimum_libevent_version]) - - AC_CACHE_CHECK(whether libevent build works, php_cv_libevent_build_works, [ - PHP_TEST_BUILD(event_init, - [ - php_cv_libevent_build_works=yes - ], [ - AC_MSG_RESULT(no) - AC_MSG_ERROR([build test failed. Please check the config.log for details.]) - ], $LIBEVENT_LIBS) - ]) - - PHP_SETUP_LIBXML(FPM_SHARED_LIBADD, [ - ], [ - AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.]) - ]) - - AC_FPM_CHECKS - AC_FPM_ARGS - AC_FPM_VARS - PHP_OUTPUT(sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.1) PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/fpm/Makefile.frag], [$abs_srcdir/sapi/fpm], [sapi/fpm]) diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c index b92e5de634..0ffe19f0c5 100644 --- a/sapi/fpm/fpm/fpm_conf.c +++ b/sapi/fpm/fpm/fpm_conf.c @@ -518,7 +518,11 @@ static int fpm_conf_post_process() /* {{{ */ } if (!fpm_global_config.error_log) { - fpm_global_config.error_log = strdup(PHP_FPM_LOG_PATH); + char *tmp_log_path; + + spprintf(&tmp_log_path, 0, "%s/log/php-fpm.log", PHP_LOCALSTATEDIR); + fpm_global_config.error_log = strdup(tmp_log_path); + efree(tmp_log_path); } fpm_evaluate_full_path(&fpm_global_config.error_log); diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in index 1bbee12f4c..851636b437 100644 --- a/sapi/fpm/php-fpm.conf.in +++ b/sapi/fpm/php-fpm.conf.in @@ -6,10 +6,10 @@ <section name="global_options"> Pid file - <value name="pid_file">@php_fpm_pid_path@</value> + <value name="pid_file">@EXPANDED_LOCALSTATEDIR@/run/php-fpm.pid</value> Error log file - <value name="error_log">@php_fpm_log_path@</value> + <value name="error_log">@EXPANDED_LOCALSTATEDIR@/log/php-fpm.log</value> Log level <value name="log_level">notice</value> @@ -110,7 +110,7 @@ <value name="request_slowlog_timeout">0s</value> The log file for slow requests - <value name="slowlog">@php_fpm_log_path@.slow</value> + <value name="slowlog">@EXPANDED_LOCALSTATEDIR@/log/php-fpm.log.slow</value> Set open file desc rlimit <value name="rlimit_files">1024</value> |