notify_push: Automatically restart notify_push on error

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
thecalcaholic 2022-09-26 22:39:13 +02:00
parent 1d7ce6d8cd
commit 2589f49377
No known key found for this signature in database
GPG Key ID: 3510056072886A8F
5 changed files with 33 additions and 32 deletions

View File

@ -206,22 +206,7 @@ else
apachectl -k graceful
## make sure the notify_push daemon is runnnig
cat > /etc/systemd/system/notify_push.service <<EOF
[Unit]
Description = Push daemon for Nextcloud clients
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/${ARCH}/notify_push" --allow-self-signed /var/www/nextcloud/config/config.php
User=www-data
[Install]
WantedBy = multi-user.target
EOF
install_template systemd/notify_push.service.sh /etc/systemd/system/notify_push.service
start_notify_push
nc_domain="$(ncc config:system:get overwrite.cli.url)"
set-nc-domain "${nc_domain}" || {

View File

@ -226,22 +226,7 @@ EOF
arch="$(uname -m)"
[[ "${arch}" =~ "armv7" ]] && arch="armv7"
cat > /etc/systemd/system/notify_push.service <<EOF
[Unit]
Description = Push daemon for Nextcloud clients
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/"${arch}"/notify_push --allow-self-signed /var/www/nextcloud/config/config.php
User=www-data
[Install]
WantedBy = multi-user.target
EOF
install_template systemd/notify_push.service.sh /etc/systemd/system/notify_push.service
[[ -f /.docker-image ]] || systemctl enable notify_push
# some added security

View File

@ -0,0 +1,23 @@
#! /bin/bash
set -e
source /usr/local/etc/library.sh
cat <<EOF
[Unit]
Description = Push daemon for Nextcloud clients
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/${ARCH}/notify_push" --allow-self-signed /var/www/nextcloud/config/config.php
User=www-data
Restart=on-failure
RestartSec=20
[Install]
WantedBy = multi-user.target
EOF

View File

@ -175,6 +175,8 @@ fi
# update to the latest NC version
is_active_app nc-autoupdate-nc && run_app nc-autoupdate-nc
start_notify_push
# Refresh ncp config values
source /usr/local/etc/library.sh

6
updates/1.50.1.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
set -e
source /usr/local/etc/library.sh
install_template systemd/notify_push.service.sh /etc/systemd/system/notify_push.service