From a24c9fbafbd769c43ee2f8041feada491e81d662 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Thu, 15 Nov 2018 14:54:12 +0100 Subject: [PATCH] Put cloudron-updater (installer.sh) logs persistently to /var/log/ --- src/scripts/update.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scripts/update.sh b/src/scripts/update.sh index 72f72b15e..e9e6bf0f2 100755 --- a/src/scripts/update.sh +++ b/src/scripts/update.sh @@ -8,6 +8,8 @@ if [[ ${EUID} -ne 0 ]]; then fi readonly UPDATER_SERVICE="cloudron-updater" +readonly DATETIME=`date '+%Y-%m-%d_%H-%M-%S'` +readonly LOG_FILE="/var/log/cloudron-updater-${DATETIME}.log" if [[ $# == 1 && "$1" == "--check" ]]; then echo "OK" @@ -31,7 +33,7 @@ if systemctl reset-failed "${UPDATER_SERVICE}"; then fi echo "=> Run installer.sh as cloudron-updater.service" -if ! systemd-run --unit "${UPDATER_SERVICE}" ${installer_path}; then +if ! systemd-run --unit "${UPDATER_SERVICE}" -p "StandardOutput=file:${LOG_FILE}" ${installer_path}; then echo "Failed to install cloudron. See ${LOG_FILE} for details" exit 1 fi