do-agent icon indicating copy to clipboard operation
do-agent copied to clipboard

Please provide a systemd timer as alternative to the crontab entry

Open keszybz opened this issue 3 years ago • 3 comments

On a Fedora installation, do-agent and droplet-agent are the only two things that pull in cronie and cronie-anacron. On systems where you're providing a systemd service anyway, it'd be nice to replace the crontab entry by a systemd timer and drop the dependency on cronie.

Something like this should work:

# do-agent-update.timer
[Unit]
Description=…
Wants=network-online.target

[Timer]
OnCalendar=*-*-* 01:00
RandomizedDelaySec=900
Persistent=true

[Install]
WantedBy=timers.target

# do-agent-update.service
[Unit]
Description=…
After=network-online.target

[Service]
Type=oneshot
Nice=19
IOSchedulingClass=2
IOSchedulingPriority=7
ExecStart=/opt/digitalocean/do-agent/scripts/update.sh

See e.g. dnf-automatic.timer and dnf-automatic.service for an example of how to do this well.

keszybz avatar Feb 12 '22 14:02 keszybz

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Apr 16 '22 05:04 stale[bot]

still valid

bsnyder788 avatar Apr 16 '22 07:04 bsnyder788

still valid

bsnyder788 avatar Jul 26 '22 20:07 bsnyder788