Ubuntu Unattended Upgrades causes MySQL to restart

This morning an Ubuntu Forge server had some MySQL exceptions on a client website. Flare and email errors came it. As it turns out, unattended upgrades run every day, approximately at 06h18, and then this happened. This begs the question, where are the scheduled tasks kept?

Hint: It’s not a cron job.

Unattended upgrades on Ubuntu are managed by systemd timers rather than traditional cron jobs. Specifically, there are two main timers involved:

1. apt-daily.timer:

This timer runs daily and handles general APT tasks, including updating package lists and performing upgrades.

2. apt-daily-upgrade.timer:

This timer handles the actual unattended upgrades.

# cat /lib/systemd/system/apt-daily-upgrade.timer
[Unit]
Description=Daily apt upgrade and clean activities
After=apt-daily.timer

[Timer]
OnCalendar=*-*-* 6:00
RandomizedDelaySec=60m
Persistent=true

[Install]
WantedBy=timers.target

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top