Skip to content

Autotools: Use runstatedir for var/run directory #16064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,7 @@ dnl Expand all directory names for use in macros/constants.
EXPANDED_PEAR_INSTALLDIR=$(eval echo $PEAR_INSTALLDIR)
EXPANDED_EXTENSION_DIR=$(eval echo $EXTENSION_DIR)
EXPANDED_LOCALSTATEDIR=$(eval echo $localstatedir)
EXPANDED_RUNSTATEDIR=$(eval echo $runstatedir)
EXPANDED_BINDIR=$(eval echo $bindir)
EXPANDED_SBINDIR=$(eval echo $sbindir)
EXPANDED_MANDIR=$(eval echo $mandir)
Expand All @@ -1373,6 +1374,7 @@ AC_SUBST([EXPANDED_LIBDIR])
AC_SUBST([EXPANDED_DATADIR])
AC_SUBST([EXPANDED_SYSCONFDIR])
AC_SUBST([EXPANDED_LOCALSTATEDIR])
AC_SUBST([EXPANDED_RUNSTATEDIR])
AC_SUBST([EXPANDED_PHP_CONFIG_FILE_PATH])
AC_SUBST([EXPANDED_PHP_CONFIG_FILE_SCAN_DIR])
AC_SUBST([PHP_INSTALLED_SAPIS])
Expand Down Expand Up @@ -1439,6 +1441,7 @@ PHP_SUBST([mandir])
PHP_SUBST([phptempdir])
PHP_SUBST([prefix])
PHP_SUBST([localstatedir])
PHP_SUBST([runstatedir])
PHP_SUBST([datadir])
PHP_SUBST([datarootdir])
PHP_SUBST([sysconfdir])
Expand Down
2 changes: 1 addition & 1 deletion sapi/fpm/Makefile.frag
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ install-fpm: $(SAPI_FPM_PATH)
@echo "Installing PHP FPM binary: $(INSTALL_ROOT)$(sbindir)/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(sbindir)
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/log
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/run
@$(mkinstalldirs) $(INSTALL_ROOT)$(runstatedir)
@$(INSTALL) -m 0755 $(SAPI_FPM_PATH) $(INSTALL_ROOT)$(sbindir)/$(program_prefix)php-fpm$(program_suffix)$(EXEEXT)

@if test -f "$(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf"; then \
Expand Down
4 changes: 0 additions & 4 deletions sapi/fpm/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,6 @@ if test "$PHP_FPM" != "no"; then

AC_SUBST([php_fpm_user])
AC_SUBST([php_fpm_group])
php_fpm_sysconfdir=$(eval echo $sysconfdir)
AC_SUBST([php_fpm_sysconfdir])
php_fpm_localstatedir=$(eval echo $localstatedir)
AC_SUBST([php_fpm_localstatedir])
php_fpm_prefix=$(eval echo $prefix)
AC_SUBST([php_fpm_prefix])

Expand Down
2 changes: 1 addition & 1 deletion sapi/fpm/init.d.php-fpm.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exec_prefix=@exec_prefix@

php_fpm_BIN=@sbindir@/php-fpm
php_fpm_CONF=@sysconfdir@/php-fpm.conf
php_fpm_PID=@localstatedir@/run/php-fpm.pid
php_fpm_PID=@runstatedir@/php-fpm.pid

php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID"

Expand Down
8 changes: 4 additions & 4 deletions sapi/fpm/php-fpm.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ php-fpm \- PHP FastCGI Process Manager 'PHP-FPM'
.LP
.SH DESCRIPTION
\fBPHP\fP is a widely\-used general\-purpose scripting language that is especially suited for
Web development and can be embedded into HTML. This is a variant of PHP that will run in the background as a daemon, listening for CGI requests. Output is logged to @php_fpm_localstatedir@/log/php-fpm.log.
Web development and can be embedded into HTML. This is a variant of PHP that will run in the background as a daemon, listening for CGI requests. Output is logged to @EXPANDED_LOCALSTATEDIR@/log/php-fpm.log.
.LP
Most options are set in the configuration file. The configuration file is @php_fpm_sysconfdir@/php-fpm.conf. By default, php-fpm will respond to CGI requests listening on localhost http port 9000. Therefore php-fpm expects your webserver to forward all requests for '.php' files to port 9000 and you should edit your webserver configuration file appropriately.
Most options are set in the configuration file. The configuration file is @EXPANDED_SYSCONFDIR@/php-fpm.conf. By default, php-fpm will respond to CGI requests listening on localhost http port 9000. Therefore php-fpm expects your webserver to forward all requests for '.php' files to port 9000 and you should edit your webserver configuration file appropriately.
.SH OPTIONS
.TP 15
.B \-C
Expand Down Expand Up @@ -97,7 +97,7 @@ Specify the PID file location.
.TP
.PD 1
.B \-y
Specify alternative path to FastCGI process manager configuration file (the default is @php_fpm_sysconfdir@/php-fpm.conf)
Specify alternative path to FastCGI process manager configuration file (the default is @EXPANDED_SYSCONFDIR@/php-fpm.conf)
.TP
.PD 0
.B \-\-test
Expand Down Expand Up @@ -156,7 +156,7 @@ For any unix systems which use systemd for their main process manager, you shoul
sudo systemctl start php-fpm.service
.RE
.TP
If your installation has no appropriate init script, launch php-fpm with no arguments. It will launch as a daemon (background process) by default. The file @php_fpm_localstatedir@/run/php-fpm.pid determines whether php-fpm is already up and running. Once started, php-fpm then responds to several POSIX signals:
If your installation has no appropriate init script, launch php-fpm with no arguments. It will launch as a daemon (background process) by default. The file @EXPANDED_RUNSTATEDIR@/php-fpm.pid determines whether php-fpm is already up and running. Once started, php-fpm then responds to several POSIX signals:
.P
.PD 0
.RS
Expand Down
2 changes: 1 addition & 1 deletion sapi/fpm/php-fpm.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p argument)
; - @prefix@ otherwise
include=@php_fpm_sysconfdir@/php-fpm.d/*.conf
include=@EXPANDED_SYSCONFDIR@/php-fpm.d/*.conf
2 changes: 1 addition & 1 deletion sapi/fpm/php-fpm.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ After=network.target

[Service]
Type=@php_fpm_systemd@
PIDFile=@EXPANDED_LOCALSTATEDIR@/run/php-fpm.pid
PIDFile=@EXPANDED_RUNSTATEDIR@/php-fpm.pid
ExecStart=@EXPANDED_SBINDIR@/php-fpm --nodaemonize --fpm-config @EXPANDED_SYSCONFDIR@/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID

Expand Down
2 changes: 1 addition & 1 deletion sapi/phpdbg/Makefile.frag
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install-phpdbg: $(BUILD_BINARY)
@echo "Installing phpdbg binary: $(INSTALL_ROOT)$(bindir)/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/log
@$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/run
@$(mkinstalldirs) $(INSTALL_ROOT)$(runstatedir)
@$(INSTALL) -m 0755 $(BUILD_BINARY) $(INSTALL_ROOT)$(bindir)/$(program_prefix)phpdbg$(program_suffix)$(EXEEXT)
@echo "Installing phpdbg man page: $(INSTALL_ROOT)$(mandir)/man1/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
Expand Down
Loading