diff --git a/scripts/cloudron-support b/scripts/cloudron-support index c0214d1f9..65cddc0ee 100755 --- a/scripts/cloudron-support +++ b/scripts/cloudron-support @@ -94,7 +94,7 @@ echo -e $LINE"Backup stats (possibly misleading)"$LINE >> $OUT du -hcsL /var/backups/* &>> $OUT || true echo -e $LINE"System daemon status"$LINE >> $OUT -systemctl status --lines=100 cloudron.target box mysql unbound cloudron-syslog nginx collectd docker &>> $OUT +systemctl status --lines=100 box mysql unbound cloudron-syslog nginx collectd docker &>> $OUT echo -e $LINE"Box logs"$LINE >> $OUT tail -n 100 /home/yellowtent/platformdata/logs/box.log &>> $OUT diff --git a/scripts/installer.sh b/scripts/installer.sh index e5cd22111..d0725c08b 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -124,7 +124,7 @@ if ! id "${user}" 2>/dev/null; then fi if [[ "${is_update}" == "yes" ]]; then - echo "==> installer: stop cloudron.target service for update" + echo "==> installer: stop box service for update" ${box_src_dir}/setup/stop.sh fi diff --git a/setup/start.sh b/setup/start.sh index f97364c1d..24d373a3b 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -100,11 +100,13 @@ unbound-anchor -a /var/lib/unbound/root.key echo "==> Adding systemd services" cp -r "${script_dir}/start/systemd/." /etc/systemd/system/ +systemctl disable cloudron.target || true +rm -f /etc/systemd/system/cloudron.target [[ "${ubuntu_version}" == "16.04" ]] && sed -e 's/MemoryMax/MemoryLimit/g' -i /etc/systemd/system/box.service systemctl daemon-reload systemctl enable unbound systemctl enable cloudron-syslog -systemctl enable cloudron.target +systemctl enable box systemctl enable cloudron-firewall # update firewall rules @@ -227,7 +229,7 @@ chown "${USER}:${USER}" "${BOX_DATA_DIR}/mail" chown "${USER}:${USER}" -R "${BOX_DATA_DIR}/mail/dkim" # this is owned by box currently since it generates the keys echo "==> Starting Cloudron" -systemctl start cloudron.target +systemctl start box sleep 2 # give systemd sometime to start the processes diff --git a/setup/start/systemd/box.service b/setup/start/systemd/box.service index 479caf043..180051af4 100644 --- a/setup/start/systemd/box.service +++ b/setup/start/systemd/box.service @@ -1,13 +1,15 @@ [Unit] Description=Cloudron Admin OnFailure=crashnotifier@%n.service -StopWhenUnneeded=true ; journald crashes result in a EPIPE in node. Cannot ignore it as it results in loss of logs. BindsTo=systemd-journald.service After=mysql.service nginx.service ; As cloudron-resize-fs is a one-shot, the Wants= automatically ensures that the service *finishes* Wants=cloudron-resize-fs.service +[Install] +WantedBy=multi-user.target + [Service] Type=idle WorkingDirectory=/home/yellowtent/box diff --git a/setup/start/systemd/cloudron.target b/setup/start/systemd/cloudron.target deleted file mode 100644 index 6df10b1b6..000000000 --- a/setup/start/systemd/cloudron.target +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Cloudron Smartserver -Documentation=https://cloudron.io/documentation.html -StopWhenUnneeded=true -Requires=box.service -After=box.service -# AllowIsolate=yes - -[Install] -WantedBy=multi-user.target diff --git a/setup/stop.sh b/setup/stop.sh index 120804d5a..e68694023 100755 --- a/setup/stop.sh +++ b/setup/stop.sh @@ -4,4 +4,4 @@ set -eu -o pipefail echo "Stopping cloudron" -systemctl stop cloudron.target +systemctl stop box