#1008646 generic php-fpm.sock not created on sysvinit systems

Package:
php7.4-fpm
Source:
php7.4
Submitter:
Joseph Nahmias
Date:
2022-03-30 02:48:04 UTC
Severity:
normal
Tags:
#1008646#5
Date:
2022-03-30 02:45:12 UTC
From:
To:
Hello,

I've noticed that the php7.4-fpm package doesn't create the generic socket file
/run/php/php-fpm.sock (managed by alternatives) when using sysvinit. It seems
this was rolled into the systemd service unit file, but wasn't added to the
sysvinit script. Here's a patch that adds it (along with an related bugfix
for the permissions of the /run/php directory):
--- /etc/init.d/php7.4-fpm.orig 2021-10-23 21:53:50.000000000 +0000
+++ /etc/init.d/php7.4-fpm      2022-03-30 02:31:05.339118410 +0000
@@ -49,6 +49,7 @@
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
                $DAEMON_ARGS 2>/dev/null \
                || return 2
+       /usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74
        # Add code here, if necessary, that waits for the process to be ready
        # to handle requests from services started subsequently which depend
        # on this one.  As a last resort, sleep for some time.
@@ -77,6 +78,7 @@
        [ "$?" = 2 ] && return 2
        # Many daemons don't delete their pidfiles when they exit.
        rm -f $PIDFILE
+       /usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74
        return "$RETVAL"
 }

@@ -96,7 +98,7 @@
 case "$1" in
     start)
        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
-       mkdir --mode=07500 /run/php
+       mkdir --parents --mode=0755 /run/php
        chown www-data:www-data /run/php
        case "$?" in
            0)