[__php_fpm*] add support for Debian and Ubuntu
This commit is contained in:
parent
116acebd10
commit
b7ba43553b
5 changed files with 51 additions and 25 deletions
|
@ -20,7 +20,7 @@ variables_order = "GPCS"
|
||||||
zend.assertions = -1
|
zend.assertions = -1
|
||||||
|
|
||||||
; Local custom variations
|
; Local custom variations
|
||||||
include_path = ".:/usr/share/php${PHPVER:?}"
|
include_path = ".:${PHP_INCLUDEDIR}"
|
||||||
memory_limit = ${MEMORY_LIMIT:?}
|
memory_limit = ${MEMORY_LIMIT:?}
|
||||||
post_max_size = ${UPLOAD_MAX_FILESIZE:?}
|
post_max_size = ${UPLOAD_MAX_FILESIZE:?}
|
||||||
upload_max_filesize = ${UPLOAD_MAX_FILESIZE:?}
|
upload_max_filesize = ${UPLOAD_MAX_FILESIZE:?}
|
||||||
|
|
|
@ -12,8 +12,7 @@ This type installs and configures PHP-FPM for a given version of PHP. It is
|
||||||
expected to be used in combination with cdist-type__php_fpm_pool, which
|
expected to be used in combination with cdist-type__php_fpm_pool, which
|
||||||
configures specific pools.
|
configures specific pools.
|
||||||
|
|
||||||
Note that currently, this type is only implemented for Alpine Linux.
|
This type supports Debian, Ubuntu and Alpine Linux.
|
||||||
|
|
||||||
|
|
||||||
REQUIRED PARAMETERS
|
REQUIRED PARAMETERS
|
||||||
-------------------
|
-------------------
|
||||||
|
|
|
@ -6,18 +6,39 @@ PHPVER=$(cat "${__object:?}/parameter/php-version")
|
||||||
export PHPVER
|
export PHPVER
|
||||||
|
|
||||||
case "$os" in
|
case "$os" in
|
||||||
'alpine')
|
'alpine')
|
||||||
package="php${PHPVER}-fpm"
|
# Alpine packages looks like php81-fpm - we make sure to remove dots from user
|
||||||
service="php-fpm${PHPVER}"
|
# input.
|
||||||
opcache_package="php${PHPVER}-opcache"
|
PHPVER=$(echo "$PHPVER" | tr -d '.')
|
||||||
apcu_package="php${PHPVER}-pecl-apcu"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
package="php${PHPVER}-fpm"
|
||||||
printf "Your operating system is currently not supported by this type\n" >&2
|
opcache_package="php${PHPVER}-opcache"
|
||||||
printf "Please contribute an implementation for it if you can.\n" >&2
|
apcu_package="php${PHPVER}-pecl-apcu"
|
||||||
exit 1
|
|
||||||
|
service="php-fpm${PHPVER}"
|
||||||
|
php_confdir="/etc/php${PHPVER}"
|
||||||
|
php_ini="${php_confdir:?}/php.ini"
|
||||||
|
|
||||||
|
PHP_INCLUDEDIR="/usr/share/php${PHPVER:?}"
|
||||||
|
export PHP_INCLUDEDIR
|
||||||
;;
|
;;
|
||||||
|
'debian'|'ubuntu')
|
||||||
|
package="php${PHPVER}-fpm"
|
||||||
|
opcache_package="php${PHPVER}-opcache"
|
||||||
|
apcu_package="php${PHPVER}-apcu"
|
||||||
|
|
||||||
|
service="php${PHPVER}-fpm"
|
||||||
|
php_confdir="/etc/php/${PHPVER}"
|
||||||
|
php_ini="${php_confdir:?}/fpm/php.ini"
|
||||||
|
|
||||||
|
PHP_INCLUDEDIR="/usr/share/php/${PHPVER:?}"
|
||||||
|
export PHP_INCLUDEDIR
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf "Your operating system is currently not supported by this type\n" >&2
|
||||||
|
printf "Please contribute an implementation for it if you can.\n" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
__package "$package"
|
__package "$package"
|
||||||
|
@ -40,8 +61,8 @@ export UPLOAD_MAX_FILESIZE
|
||||||
mkdir -p "${__object:?}/files"
|
mkdir -p "${__object:?}/files"
|
||||||
"${__type:?}/files/php.ini.sh" >"${__object:?}/files/php.ini"
|
"${__type:?}/files/php.ini.sh" >"${__object:?}/files/php.ini"
|
||||||
|
|
||||||
require="__package/$package" __file "/etc/php${PHPVER}/php.ini" \
|
require="__package/$package" __file "${php_ini:?}" \
|
||||||
--mode 644 --source "${__object:?}/files/php.ini" \
|
--mode 644 --source "${__object:?}/files/php.ini" \
|
||||||
--onchange "service $service restart"
|
--onchange "service $service restart"
|
||||||
|
|
||||||
require="__file/etc/php${PHPVER}/php.ini" __service "$service" --action start
|
require="__file/${php_ini:?}" __service "$service" --action start
|
||||||
|
|
|
@ -13,7 +13,7 @@ This type configures a pool named after the `__object_id` for a specified PHP
|
||||||
version. Note that this types expects a same-version cdist-type__php_fpm type
|
version. Note that this types expects a same-version cdist-type__php_fpm type
|
||||||
to have been run first: the user is responsible for doing so.
|
to have been run first: the user is responsible for doing so.
|
||||||
|
|
||||||
Note that currently, this type is only implemented for Alpine Linux.
|
This type supports Debian, Ubuntu and Alpine Linux.
|
||||||
|
|
||||||
|
|
||||||
REQUIRED PARAMETERS
|
REQUIRED PARAMETERS
|
||||||
|
|
|
@ -7,16 +7,22 @@ PHPVER=$(cat "${__object:?}/parameter/php-version")
|
||||||
export PHPVER
|
export PHPVER
|
||||||
|
|
||||||
case "$os" in
|
case "$os" in
|
||||||
'alpine')
|
'alpine')
|
||||||
service="php-fpm${PHPVER}"
|
PHPVER=$(echo "$PHP_VERSION" | tr -d '.')
|
||||||
:
|
service="php-fpm${PHPVER}"
|
||||||
|
php_confdir="/etc/php${PHPVER}"
|
||||||
|
php_pooldir="${php_confdir:?}/php-fpm.d"
|
||||||
;;
|
;;
|
||||||
|
'debian'|'ubuntu')
|
||||||
*)
|
service="php${PHPVER}-fpm"
|
||||||
printf "Your operating system is currently not supported by this type\n" >&2
|
php_confdir="/etc/php/${PHPVER}"
|
||||||
printf "Please contribute an implementation for it if you can.\n" >&2
|
php_pooldir="${php_confdir:?}/fpm/pool.d"
|
||||||
exit 1
|
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
printf "Your operating system is currently not supported by this type\n" >&2
|
||||||
|
printf "Please contribute an implementation for it if you can.\n" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
POOL_NAME="$name"
|
POOL_NAME="$name"
|
||||||
|
@ -29,6 +35,6 @@ export POOL_USER POOL_GROUP POOL_LISTEN_ADDR POOL_LISTEN_OWNER POOL_NAME
|
||||||
mkdir -p "${__object:?}/files"
|
mkdir -p "${__object:?}/files"
|
||||||
"${__type:?}/files/www.conf.sh" >"${__object:?}/files/www.conf"
|
"${__type:?}/files/www.conf.sh" >"${__object:?}/files/www.conf"
|
||||||
|
|
||||||
__file "/etc/php${PHPVER:?}/php-fpm.d/${name}.conf" \
|
__file "${php_pooldir:?}/${name}.conf" \
|
||||||
--mode 644 --source "${__object:?}/files/www.conf" \
|
--mode 644 --source "${__object:?}/files/www.conf" \
|
||||||
--onchange "service $service reload"
|
--onchange "service $service reload"
|
||||||
|
|
Loading…
Reference in a new issue