From 4955b27a6150c8dd2136951413a69ed943d2faff Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 16 Jan 2017 15:30:59 +0100 Subject: [SSUS] Check if patch_lighttpd_phpchildren is included before trying to install it --- satellit_upgrader/updater.template.sh | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'satellit_upgrader/updater.template.sh') diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 5f02736..09721ca 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -296,25 +296,23 @@ if [ -e "$FILEDIR/lighttpd.conf" ] && [ -e "/etc/lighttpd/lighttpd.conf" ]; then 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_lighttpd_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 +if [ -e "$FILEDIR/patch_lighttpd_phpchildren" ]; then + echo "* lighttpd: dynamic php children value" + cp "$FILEDIR/patch_lighttpd_phpchildren" /usr/local/sbin || perror "Could not copy patch_lighttpd_phpchildren script!" + 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!" + chmod +x /usr/local/sbin/patch_lighttpd_phpchildren # Just to sleep better in dark nights. + systemctl daemon-reload + RESTART_LIGHTY=ja + fi + echo "Done." else - echo " patch_lighttpd_phpchildren entry already there, doing nothing." + pwarning "lighttpd.service not found. Doing nothing." fi -else - echo " not found. Doing nothing." fi # ************************** PHP *************************** -- cgit v1.2.3-55-g7522