From 19ae3b021f4395d4543181836aee1a1ce4932919 Mon Sep 17 00:00:00 2001 From: Kayou Date: Sun, 1 Sep 2024 10:51:41 +0200 Subject: [PATCH] Fix notify_push after reboot/restart the service, create the folder /var/run/nextcloud via systemd --- conf/systemd.service | 1 + scripts/config | 3 --- scripts/install | 3 --- scripts/remove | 1 - scripts/restore | 3 --- scripts/upgrade | 3 --- 6 files changed, 1 insertion(+), 13 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 855a294..bbe6573 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -4,6 +4,7 @@ Description = Push daemon for Nextcloud clients [Service] Environment=SOCKET_PATH=/var/run/__APP__/notify-push.sock Environment=ALLOW_SELF_SIGNED=true +RuntimeDirectory=__APP__ ExecStart=__INSTALL_DIR__/apps/notify_push/bin/__ARCH__/notify_push __INSTALL_DIR__/config/config.php Type=notify User=__APP__ diff --git a/scripts/config b/scripts/config index 189c448..d756fa9 100644 --- a/scripts/config +++ b/scripts/config @@ -127,9 +127,6 @@ set__enable_notify_push() { fi exec_occ config:app:set notify_push base_endpoint --value https://$domain${path_url%/}/push - mkdir -p /var/run/$app/ - chown $app: /var/run/$app/ - case $YNH_ARCH in amd64) arch="x86_64";; arm64) arch="aarch64";; diff --git a/scripts/install b/scripts/install index 2df768a..a4ef70a 100755 --- a/scripts/install +++ b/scripts/install @@ -212,9 +212,6 @@ then exec_occ app:install notify_push exec_occ config:app:set notify_push base_endpoint --value https://$domain${path_url%/}/push - mkdir -p /var/run/$app/ - chown $app: /var/run/$app/ - case $YNH_ARCH in amd64) arch="x86_64";; arm64) arch="aarch64";; diff --git a/scripts/remove b/scripts/remove index 7f67cf5..4bf6421 100755 --- a/scripts/remove +++ b/scripts/remove @@ -28,7 +28,6 @@ ynh_remove_systemd_config --service="${app}-notify-push" ynh_exec_warn_less systemctl disable --now ${app}-notify-push-watcher.path ynh_secure_remove --file="/etc/systemd/system/${app}-notify-push-watcher.path" ynh_remove_systemd_config --service="${app}-notify-push-watcher" -ynh_secure_remove --file="/var/run/$app" # Remove a cron file # TODO: Ensure that cron job is not running (How !?) diff --git a/scripts/restore b/scripts/restore index 1393ae3..d954430 100755 --- a/scripts/restore +++ b/scripts/restore @@ -130,9 +130,6 @@ ynh_systemd_action --action=restart --service_name=fail2ban if [ $enable_notify_push -eq 1 ] then - mkdir -p /var/run/$app/ - chown $app: /var/run/$app/ - ynh_restore_file --origin_path="/etc/systemd/system/${app}-notify-push.service" ynh_restore_file --origin_path="/etc/systemd/system/${app}-notify-push-watcher.service" ynh_restore_file --origin_path="/etc/systemd/system/${app}-notify-push-watcher.path" diff --git a/scripts/upgrade b/scripts/upgrade index 7706d05..5313109 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -397,9 +397,6 @@ then fi exec_occ config:app:set notify_push base_endpoint --value https://$domain${path_url%/}/push - mkdir -p /var/run/$app/ - chown $app: /var/run/$app/ - case $YNH_ARCH in amd64) arch="x86_64";; arm64) arch="aarch64";;