I would try to set in /etc/systemd/system/multi-user.target.wants/notify_push.service the following line
After=nginx.service php8.1-fpm.service mysql.service redis.service
And comment out or delete the second “After=redis.service” line.
That works! Thank you, @chrissi55! I restarted the server five times. notify_push
runs normal and no more 503-errors so far.
On my server it’s apache2.service
instead of nginx.service
.
/etc/systemd/system/multi-user.target.wants/notify_push.service
now looks like this:
[Unit]
Description = Push daemon for Nextcloud clients
After=apache2.service php8.1-fpm.service mysql.service redis.service
#After=mysql.service
#After=redis.service
Requires=redis.service
[Service]
Environment=PORT=7867
Environment=NEXTCLOUD_URL=https://localhost
ExecStart="/var/www/nextcloud/apps/notify_push/bin/aarch64/notify_push" --allow>
User=www-data
Restart=on-failure
RestartSec=20
[Install]
WantedBy = multi-user.target
With
systemctl restart php8.1-fpm
you flushed opcache as well and forced it to be rebuild on the first incoming request. (Source: How To Clear PHP’s Opcache)
That’s good to know. Maybe I was too impatient when I tried this first to clear php-opcache. I’ll add systemctl restart php8.1-fpm
to cron as php-opcache is kind of a bottleneck with Nextcloud.