summaryrefslogtreecommitdiffstats
path: root/satellit_upgrader/updater.template.sh
diff options
context:
space:
mode:
Diffstat (limited to 'satellit_upgrader/updater.template.sh')
-rw-r--r--satellit_upgrader/updater.template.sh17
1 files changed, 11 insertions, 6 deletions
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