Apache2 woes

Tuesday, January 20, 2026 at 21:41:57

Something that runs around 6:19am on vps is shutting down apache2, then trying to restart/graceful restart it, but the restart fails because it runs BEFORE apache2 shuts down.

I’m currently attempting to edit /etc/needrestart/needrestart.conf (found this after hours of searching):
changed this:

#$nrconf{restart} = ‘i’;

to this:

$nrconf{restart} = ‘a’;

Fingers crossed.

Also, added this block to /etc/apt/apt.conf.d/50unattended-upgrades

Unattended-Upgrade::Post-Invoke-Success {
    "if systemctl list-units --all --type=service | grep -q 'apache2'; then systemctl restart apache2; fi";
};

Add comment

Fill out the form below to add your own comments