I've created a little update/upgrade program for my arch-based linux. Instead of using a cronjob I'm using systemd and created following files:
/etc/systemd/system: uupgrades.target & uupgrades.timer
[Unit] Description=UU Upgrades Timer Target StopWhenUnneeded=yes [Unit] Description=UU Upgrades Timer [Timer] OnBootSec=8min OnUnitActiveSec=7h Unit=uupgrades.target [Install] WantedBy=basic.target
/etc/systemd/system/uupgrades.target.wants I've the
[Unit] Description=UU Update Program [Service] Nice=19 IOSchedulingClass=2 IOSchedulingPriority=7 ExecStart=/usr/bin/uupgrades
/etc/systemd/system/basic.target.wants a symlink to
What I want to, is just that shutdown, reboot, suspend, hibernate, ... is delayed until uupgrades is not active anymore, when it is active.
How can I achieve this? A GUI/DE still running is not required.