From c982debf7981230c5b481dcc2af86815c654c99b Mon Sep 17 00:00:00 2001 From: nachoparker Date: Mon, 11 Sep 2017 18:50:54 +0200 Subject: ncp-web: fix php exec with background restarting of processes --- changelog.md | 8 ++++++-- etc/nextcloudpi-config.d/letsencrypt.sh | 2 +- etc/nextcloudpi-config.d/modsecurity.sh | 2 +- etc/nextcloudpi-config.d/nc-httpsonly.sh | 2 +- etc/nextcloudpi-config.d/nc-restore.sh | 16 ++++++++-------- etc/nextcloudpi-config.d/nc-webui.sh | 2 +- update.sh | 11 ----------- 7 files changed, 18 insertions(+), 25 deletions(-) diff --git a/changelog.md b/changelog.md index 6d44da3a..424082b3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,11 @@ -[v0.26.28](https://github.com/nextcloud/nextcloudpi/commit/94eb3ce) (2017-09-08) nc-backup: small fixes +[v0.26.30](https://github.com/nextcloud/nextcloudpi/commit/49705ee) (2017-09-11) ncp-web: fix php exec with background restarting of processes -[v0.26.27](https://github.com/nextcloud/nextcloudpi/commit/649e8b7) (2017-09-10) ncp-web: link to wiki info for each extra +[v0.26.29](https://github.com/nextcloud/nextcloudpi/commit/14167d4) (2017-09-11) remove config txt output + +[v0.26.28](https://github.com/nextcloud/nextcloudpi/commit/eba23ea) (2017-09-08) nc-backup: small fixes + +[v0.26.27](https://github.com/nextcloud/nextcloudpi/commit/3ec03de) (2017-09-10) ncp-web: link to wiki info for each extra [v0.26.26](https://github.com/nextcloud/nextcloudpi/commit/6f25713) (2017-09-10) ncp-web: minor tweaks diff --git a/etc/nextcloudpi-config.d/letsencrypt.sh b/etc/nextcloudpi-config.d/letsencrypt.sh index ddb3802c..7950e328 100644 --- a/etc/nextcloudpi-config.d/letsencrypt.sh +++ b/etc/nextcloudpi-config.d/letsencrypt.sh @@ -62,7 +62,7 @@ configure() sudo -u www-data php $OCC config:system:set overwrite.cli.url --value=https://$DOMAIN_ # delayed in bg so it does not kill the connection, and we get AJAX response - ( sleep 2 && systemctl restart apache2 ) &>/dev/null & + bash -c "sleep 2 && systemctl restart apache2" &>/dev/null & } rm -rf $NCDIR/.well-known } diff --git a/etc/nextcloudpi-config.d/modsecurity.sh b/etc/nextcloudpi-config.d/modsecurity.sh index 81a9bd03..af78247d 100644 --- a/etc/nextcloudpi-config.d/modsecurity.sh +++ b/etc/nextcloudpi-config.d/modsecurity.sh @@ -101,7 +101,7 @@ EOF [[ $ACTIVE_ == "yes" ]] && a2enmod security2 &>/dev/null || a2dismod security2 &>/dev/null # delayed in bg so it does not kill the connection, and we get AJAX response - ( sleep 2 && systemctl restart apache2 ) &>/dev/null & + bash -c "sleep 2 && systemctl restart apache2" &>/dev/null & } cleanup() diff --git a/etc/nextcloudpi-config.d/nc-httpsonly.sh b/etc/nextcloudpi-config.d/nc-httpsonly.sh index 02b57d72..d1fe9ffb 100644 --- a/etc/nextcloudpi-config.d/nc-httpsonly.sh +++ b/etc/nextcloudpi-config.d/nc-httpsonly.sh @@ -24,7 +24,7 @@ configure() echo "Forcing HTTPS $OPT" # delayed in bg so it does not kill the connection, and we get AJAX response - ( sleep 2 && systemctl restart apache2 ) &>/dev/null & + bash -c "sleep 2 && systemctl restart apache2" &>/dev/null & } install() { :; } diff --git a/etc/nextcloudpi-config.d/nc-restore.sh b/etc/nextcloudpi-config.d/nc-restore.sh index 6d4c221f..d7a9702b 100644 --- a/etc/nextcloudpi-config.d/nc-restore.sh +++ b/etc/nextcloudpi-config.d/nc-restore.sh @@ -90,14 +90,14 @@ EOF sudo -u www-data php occ files:scan --all # cache needs to be cleaned as of NC 12 - ( - sleep 3 - systemctl stop php7.0-fpm - systemctl stop mysqld - sleep 0.5 - systemctl start php7.0-fpm - systemctl start mysqld - ) &>/dev/null & + + bash -c " sleep 3 + systemctl stop php7.0-fpm + systemctl stop mysqld + sleep 0.5 + systemctl start php7.0-fpm + systemctl start mysqld + " &>/dev/null & fi rm -r "$TMPDIR" diff --git a/etc/nextcloudpi-config.d/nc-webui.sh b/etc/nextcloudpi-config.d/nc-webui.sh index aef2438f..f1c2ef9b 100644 --- a/etc/nextcloudpi-config.d/nc-webui.sh +++ b/etc/nextcloudpi-config.d/nc-webui.sh @@ -27,7 +27,7 @@ configure() fi # delayed in bg so it does not kill the connection, and we get AJAX response - ( sleep 2 && systemctl restart apache2 ) &>/dev/null & + bash -c "sleep 2 && systemctl restart apache2" &>/dev/null & } install() { :; } diff --git a/update.sh b/update.sh index cb382e6b..fde639f9 100755 --- a/update.sh +++ b/update.sh @@ -148,17 +148,6 @@ test -f /usr/local/etc/ncp-baseimage || echo "untagged" > /usr/local/etc/ncp-bas # remove artifacts rm -f /usr/local/etc/nextcloudpi-config.d/config_.txt - # restart PHP to get updates in the ncp-web - # FIXME: php doesn't come up if run from ncp-web - #( - #sleep 3 - #systemctl stop php7.0-fpm - #systemctl stop mysqld - #sleep 0.5 - #systemctl start php7.0-fpm - #systemctl start mysqld - #) &>/dev/null & - # License # # This script is free software; you can redistribute it and/or modify it -- cgit v1.2.3