summaryrefslogtreecommitdiffstats
path: root/satellit_upgrader
diff options
context:
space:
mode:
authorSimon Rettberg2018-04-15 13:05:22 +0200
committerSimon Rettberg2018-04-15 13:05:22 +0200
commit5b814c91def2ed350a10231b193b77c31a00c8e8 (patch)
tree9be5239fe625d6d20120993f1012f3e20ef4c914 /satellit_upgrader
parent[SSPS] Use drop-in for adjusting php child count; more error checking (diff)
downloadsetup-scripts-5b814c91def2ed350a10231b193b77c31a00c8e8.tar.gz
setup-scripts-5b814c91def2ed350a10231b193b77c31a00c8e8.tar.xz
setup-scripts-5b814c91def2ed350a10231b193b77c31a00c8e8.zip
[SSUS] Update phpchild handling aswell
Diffstat (limited to 'satellit_upgrader')
-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