From 5b814c91def2ed350a10231b193b77c31a00c8e8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sun, 15 Apr 2018 13:05:22 +0200 Subject: [SSUS] Update phpchild handling aswell --- satellit_upgrader/updater.template.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'satellit_upgrader') diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 95de6f0..f39c38a 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -375,14 +375,19 @@ diffcp "lighttpd-include-conf-d.sh" "/usr/share/lighttpd/include-conf-d.sh" && R # ********************** lighttpd php_children ************* mkdir -p /usr/local/sbin -# TODO Make this a separate service, don't patch system file if diffcp "patch_lighttpd_phpchildren" "/usr/local/sbin/patch_lighttpd_phpchildren" "Installing script to set dynamic php children value"; then if [ -f "/lib/systemd/system/lighttpd.service" ]; then - # service file found, patching dynamic php children value at system start via patchfile - if ! grep -q patch_lighttpd_phpchildren "/lib/systemd/system/lighttpd.service"; then - echo "Patching service file" - sed -i 's#\[Service\]#\[Service\]\nExecStartPre=\-/usr/local/sbin/patch_lighttpd_phpchildren#g' \ - /lib/systemd/system/lighttpd.service || perror "Could not patch service file!" + # remove old patchy way + grep -qF 'patch_lighttpd_phpchildren' "/lib/systemd/system/lighttpd.service" \ + && sed -i '/patch_lighttpd_phpchildren/d' "/lib/systemd/system/lighttpd.service" + if ! [ -f "/etc/systemd/system/lighttpd.service.d/10-dynamic_php_children" ]; then + echo "Adding drop-in to adjust php child count" + # TODO Unify with installer + mkdir -p /etc/systemd/system/lighttpd.service.d || perror "Could not create /etc/systemd/system/lighttpd.service.d" + cat > "/etc/systemd/system/lighttpd.service.d/10-dynamic_php_children" <<-HDOC + [Service] + ExecStartPre=/usr/local/sbin/patch_lighttpd_phpchildren + HDOC systemctl daemon-reload RESTART_LIGHTY=ja fi -- cgit v1.2.3-55-g7522