diff --git a/scripts/change_url b/scripts/change_url index ff2770b..399a739 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -78,7 +78,12 @@ then systemctl enable --now ${app}-notify-push-watcher.path ynh_add_systemd_config --service="${app}-notify-push" - ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php + count=0 + while ! exec_occ background:cron && [[ $count -lt 30 ]] + do + sleep 1 + count=$((count + 1)) + done ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd" --action=restart diff --git a/scripts/config b/scripts/config index 1a07d97..c3a06c6 100644 --- a/scripts/config +++ b/scripts/config @@ -141,7 +141,12 @@ set__enable_notify_push() { systemctl enable --now ${app}-notify-push-watcher.path ynh_add_systemd_config --service="${app}-notify-push" - exec_occ background:cron + count=0 + while ! exec_occ background:cron && [[ $count -lt 30 ]] + do + sleep 1 + count=$((count + 1)) + done ynh_systemd_action --service_name="${app}-notify-push-watcher" --action=restart ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd" diff --git a/scripts/install b/scripts/install index a6f4d82..9b8698a 100755 --- a/scripts/install +++ b/scripts/install @@ -299,7 +299,12 @@ ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.* if [ $enable_notify_push -eq 1 ] then - ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php + count=0 + while ! exec_occ background:cron && [[ $count -lt 30 ]] + do + sleep 1 + count=$((count + 1)) + done ynh_systemd_action --service_name="${app}-notify-push-watcher" --action=restart ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd" diff --git a/scripts/restore b/scripts/restore index 5607872..8bea858 100755 --- a/scripts/restore +++ b/scripts/restore @@ -162,7 +162,12 @@ exec_occ() { if [ $enable_notify_push -eq 1 ] then - ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php + count=0 + while ! exec_occ background:cron && [[ $count -lt 30 ]] + do + sleep 1 + count=$((count + 1)) + done ynh_systemd_action --service_name="${app}-notify-push-watcher" --action=restart ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd" --action=restart diff --git a/scripts/upgrade b/scripts/upgrade index d3763e0..e34e20a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -443,7 +443,12 @@ ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.* if [ $enable_notify_push -eq 1 ] then - ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php + count=0 + while ! exec_occ background:cron && [[ $count -lt 30 ]] + do + sleep 1 + count=$((count + 1)) + done ynh_systemd_action --service_name="${app}-notify-push-watcher" --action=restart ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd" --action=restart