Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide a systemd timer as alternative to the crontab entry #266

Open
keszybz opened this issue Feb 12, 2022 · 3 comments
Open

Please provide a systemd timer as alternative to the crontab entry #266

keszybz opened this issue Feb 12, 2022 · 3 comments

Comments

@keszybz
Copy link

keszybz commented Feb 12, 2022

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.

@stale
Copy link

stale bot commented Apr 16, 2022

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 stale bot added the stale label Apr 16, 2022
@bsnyder788
Copy link
Contributor

still valid

@stale stale bot removed the stale label Apr 16, 2022
@bsnyder788
Copy link
Contributor

still valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants