public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH 5/7] client: job: ship systemd user unit for the scheduler
Date: Wed, 14 Oct 2026 12:51:34 +0200	[thread overview]
Message-ID: <20261014105208.2747208-6-t.lamprecht@proxmox.com> (raw)
In-Reply-To: <20261014105208.2747208-1-t.lamprecht@proxmox.com>

Not enabled on install, as a backup daemon only makes sense for users
who configured a job. KillMode=mixed lets a stop wait for running
backups, and restarts give up if startup keeps failing, for example
because a scheduler already runs in a terminal.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 debian/proxmox-backup-client-static.install |  1 +
 debian/proxmox-backup-client.install        |  1 +
 debian/rules                                |  4 ++++
 etc/proxmox-backup-client-scheduler.service | 19 +++++++++++++++++++
 4 files changed, 25 insertions(+)
 create mode 100644 etc/proxmox-backup-client-scheduler.service

diff --git a/debian/proxmox-backup-client-static.install b/debian/proxmox-backup-client-static.install
index 6a913b677..8a94e1c61 100644
--- a/debian/proxmox-backup-client-static.install
+++ b/debian/proxmox-backup-client-static.install
@@ -1,3 +1,4 @@
+etc/proxmox-backup-client-scheduler.service /usr/lib/systemd/user/
 usr/share/man/man1/proxmox-backup-client.1
 usr/share/man/man1/pxar.1
 usr/share/zsh/vendor-completions/_proxmox-backup-client
diff --git a/debian/proxmox-backup-client.install b/debian/proxmox-backup-client.install
index 74b568f17..782f30f95 100644
--- a/debian/proxmox-backup-client.install
+++ b/debian/proxmox-backup-client.install
@@ -1,3 +1,4 @@
+etc/proxmox-backup-client-scheduler.service /usr/lib/systemd/user/
 usr/bin/proxmox-backup-client
 usr/bin/pxar
 usr/share/man/man1/proxmox-backup-client.1
diff --git a/debian/rules b/debian/rules
index ab48cce19..9affab277 100755
--- a/debian/rules
+++ b/debian/rules
@@ -64,6 +64,10 @@ override_dh_auto_install:
 	mv debian/tmp/usr/bin/proxmox-backup-client-static debian/proxmox-backup-client-static/usr/bin/proxmox-backup-client
 	mv debian/tmp/usr/bin/pxar-static debian/proxmox-backup-client-static/usr/bin/pxar
 
+# the scheduler is only wanted by users who configured a backup job, so do not enable it for all
+override_dh_installsystemduser:
+	dh_installsystemduser --no-enable
+
 override_dh_installsystemd:
 	dh_installsystemd -pproxmox-backup-server  proxmox-backup-daily-update.timer
 	# note: we start/try-reload-restart services manually in postinst
diff --git a/etc/proxmox-backup-client-scheduler.service b/etc/proxmox-backup-client-scheduler.service
new file mode 100644
index 000000000..00151913b
--- /dev/null
+++ b/etc/proxmox-backup-client-scheduler.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Proxmox Backup Client Scheduler
+Documentation=man:proxmox-backup-client(1)
+# give up on a startup that keeps failing, rather than retry every 30 seconds forever
+StartLimitIntervalSec=5min
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/proxmox-backup-client job scheduler
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=on-failure
+RestartSec=30
+# signal only the scheduler, which waits for the running backups
+KillMode=mixed
+# time for a running backup to finish on `systemctl --user stop`
+TimeoutStopSec=30min
+
+[Install]
+WantedBy=default.target
-- 
2.47.3





  parent reply	other threads:[~2026-10-21 20:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 10:51 [PATCH 0/7] client: add scheduled backup jobs Thomas Lamprecht
2026-10-14 10:51 ` [PATCH 1/7] client: backup specification: widen BackupDetectionMode derives Thomas Lamprecht
2026-10-14 10:51 ` [PATCH 2/7] client: job: add backup job config and state types Thomas Lamprecht
2026-10-14 10:51 ` [PATCH 3/7] client: job: add job runner and scheduled backup daemon Thomas Lamprecht
2026-10-14 10:51 ` [PATCH 4/7] client: job: add job management CLI subcommands Thomas Lamprecht
2026-10-14 10:51 ` Thomas Lamprecht [this message]
2026-10-14 10:51 ` [PATCH 6/7] client: job: add battery-check example pre-run hook Thomas Lamprecht
2026-10-14 10:51 ` [PATCH 7/7] docs: client: document scheduled backup jobs Thomas Lamprecht
2026-10-22 12:58 ` [PATCH 0/7] client: add " Christian Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261014105208.2747208-6-t.lamprecht@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal