Add a small shell helper to update the default PHP-FPM socket location
This commit is contained in:
parent
5f1073c4b5
commit
04c454c238
1
debian/php-common.install
vendored
1
debian/php-common.install
vendored
|
@ -1,3 +1,4 @@
|
||||||
|
php-fpm-socket-helper /usr/lib/php/
|
||||||
php-helper /usr/lib/php/
|
php-helper /usr/lib/php/
|
||||||
php-maintscript-helper /usr/lib/php/
|
php-maintscript-helper /usr/lib/php/
|
||||||
phpenmod /usr/sbin/
|
phpenmod /usr/sbin/
|
||||||
|
|
25
php-fpm-socket-helper
Executable file
25
php-fpm-socket-helper
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
DEFAULT_SOCKET="${2}"
|
||||||
|
POOL_FILE="${3}"
|
||||||
|
PRIORITY="${4}"
|
||||||
|
|
||||||
|
[ -r "${POOL_FILE}" ] || exit 0
|
||||||
|
|
||||||
|
SOCKET=$(sed -n 's/^listen[[:space:]]*=[[:space:]]*\([^[:space:]]*\)/\1/p' "${POOL_FILE}")
|
||||||
|
|
||||||
|
[ -S "${SOCKET}" ] || exit 0
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start|install)
|
||||||
|
/usr/bin/update-alternatives --quiet --install "${DEFAULT_SOCKET}" php-fpm.sock "${SOCKET}" "${PRIORITY}" 2>/dev/null
|
||||||
|
;;
|
||||||
|
stop|remove)
|
||||||
|
/usr/bin/update-alternatives --quiet --remove php-fpm.sock "${SOCKET}" 2>/dev/null
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Reference in a new issue