Skip to content

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

@keszybz

Description

@keszybz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions