From 42b5e20341a8360921a7aa097c50e0d27f794c7b Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Fri, 16 Dec 2016 16:32:04 +0100 Subject: [SSUS] php children (lightttpd): dyn. service file [to be tested] --- satellit_upgrader/updater.template.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'satellit_upgrader/updater.template.sh') diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 7476232..6ea26f7 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -296,7 +296,28 @@ if [ -e "$FILEDIR/lighttpd.conf" ] && [ -e "/etc/lighttpd/lighttpd.conf" ]; then echo "lighttpd config upgrade complete" fi +# ********************** lighttpd php_children ************* + +echo "* lighttpd: dynamic php children value" +echo -n "Looking for lighttpd service file..." +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_lightdm_phpchildren /lib/systemd/system/lighttpd.service; then + echo -n " found. 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!" + cp "$FILEDIR/patch_lighttpd_phpchildren" /usr/local/sbin || perror "Could not copy patch_lighttpd_phpchildren script!" + chmod +x /usr/local/sbin/patch_lighttpd_phpchildren # Just to sleep better in dark nights. + echo " done." + systemctl daemon-reload + RESTART_LIGHTY=ja + fi +else + echo " not found. Doing nothing." +fi + # ************************** PHP *************************** + declare -rg PHPINIFILE=/etc/php5/cgi/php.ini if ! grep -q 'upload_max_filesize = 100M' "$PHPINIFILE"; then echo "* Increasing php upload limit" @@ -308,7 +329,8 @@ if ! grep -q 'upload_max_filesize = 100M' "$PHPINIFILE"; then RESTART_LIGHTY=ja fi -# ** +# ************************** LIGHTY ************************ + if [ -n "$RESTART_LIGHTY" ]; then echo "* Restarting lighttpd" restart_service lighttpd -- cgit v1.2.3-55-g7522