Skip to content

Commit

Permalink
pkgadmin: Use systemd.timer instead of cron
Browse files Browse the repository at this point in the history
Now that many workstations are switched off during nighttime, we have
the problems that these don't pull new packages.

Use systemd.time and utilize `Persistent=true` to catch up on missed
events at boot time. Also use `RandomizedDelaySec=2 hours` to avoid
overloading the fileserver or the network when a new big package is
going to be pulled by all systems.
  • Loading branch information
donald committed Sep 11, 2023
1 parent 4c9704f commit 669fb49
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ install_exec prun/ptype "$DESTDIR$usr_bindir/pt
install_exec prun/pman "$DESTDIR$usr_bindir/pman"
install_exec put_websafe/put_websafe "$DESTDIR$usrlocal_bindir/put_websafe"
install_exec pkgadmin/pkgadmin "$DESTDIR$usr_sbindir/pkgadmin"
install_cron pkgadmin/crond-pkgadmin-update "$DESTDIR$crond_dir/pkgadmin-update"
install_data pkgadmin/pkgadmin-update.service "$DESTDIR$systemdunitdir/pkgadmin-update.service"
install_data pkgadmin/pkgadmin-update.timer "$DESTDIR$systemdunitdir/pkgadmin-update.timer"
install_exec mxraid/mxraid "$DESTDIR$usr_sbindir/mxraid"
install_exec mxraid/mxraid_assemble "$DESTDIR$usr_sbindir/mxraid_assemble"
install_data mxraid/mxraid.service "$DESTDIR$systemdunitdir/mxraid.service"
Expand Down
2 changes: 0 additions & 2 deletions pkgadmin/crond-pkgadmin-update

This file was deleted.

2 changes: 2 additions & 0 deletions pkgadmin/pkgadmin-update.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Service]
ExecStart=pkgadmin update
7 changes: 7 additions & 0 deletions pkgadmin/pkgadmin-update.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Timer]
OnCalendar=2:00
RandomizedDelaySec=2 hours
Persistent=true

[Install]
WantedBy=timers.target

0 comments on commit 669fb49

Please sign in to comment.