Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Debian unattended-upgrades sometimes doesn't work in OpenVZ
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Debian unattended-upgrades sometimes doesn't work in OpenVZ

blackblack Member
edited January 2015 in Help

I noticed that on some openvz containers, Debian's unattended-upgrades don't work and some do. The ones that don't work either have a unattended-upgrades-shutdown.log (that's blank) in /var/log/var/log/unattended-upgrades or just an empty directory for /var/log/unattended-upgrades. Some VMs have 512 MB of dedicated RAM that don't work and I have ones with only 128 MB of RAM that work (so I'm pretty sure it's not a memory issue). Has anyone else experienced issue, or better yet, have a solution to the problem?

Comments

  • Are you sure the automatic updates are enabled? By default they are not. Run dpkg-reconfigure unattended-upgrades and see.

  • blackblack Member
    edited January 2015

    @rds100 said:
    Are you sure the automatic updates are enabled? By default they are not. Run dpkg-reconfigure unattended-upgrades and see.

    They should be enabled. After running apt-get install unattended-upgrades, I added

    // Enable the update/upgrade script (0=disable)
    APT::Periodic::Enable "1";
    
    // Do "apt-get update" automatically every n-days (0=disable)
    APT::Periodic::Update-Package-Lists "1";
    
    // Do "apt-get upgrade --download-only" every n-days (0=disable)
    APT::Periodic::Download-Upgradeable-Packages "1";
    
    // Run the "unattended-upgrade" security upgrade script
    // every n-days (0=disabled)
    // Requires the package "unattended-upgrades" and will write
    // a log in /var/log/unattended-upgrades
    APT::Periodic::Unattended-Upgrade "1";
    
    // Do "apt-get autoclean" every n-days (0=disable)
    APT::Periodic::AutocleanInterval "7";
    
    

    in /etc/apt/apt.conf.d/02periodic

    I've used the same setup for ~20 different VMs with various providers, about 10 of them work and the other ones don't :/




    Edit: Nothing in syslog either.

    Edit2: The broken OpenVZ VMs are on different kernel verisons (so I don't think it's ovz kernel related).

  • Maybe check if /etc/cron.daily/apt is missing. Broken OpenVZ templates are unfortunately very common.

    See: http://serverfault.com/questions/568326/how-to-recreate-etc-cron-daily-apt

  • I usually do dpkg-reconfigure unattended-upgrades to enable autorun, not sure if it changes something

  • colm said: Maybe check if /etc/cron.daily/apt is missing. Broken OpenVZ templates are unfortunately very common.

    See: http://serverfault.com/questions/568326/how-to-recreate-etc-cron-daily-apt

    Thanks. /etc/cron.daily/apt appears to exist in all the OpenVZ nodes, but I followed the tutorial and reconfigured one.

    MuZo said: I usually do dpkg-reconfigure unattended-upgrades to enable autorun, not sure if it changes something

    I'll run this as well on a different node to see if it fixes things. Thanks.

  • 4n0nx4n0nx Member
    edited January 2015

    black said: I've used the same setup for ~20 different VMs with various providers, about 10 of them work and the other ones don't :/

    Same. It worked with OVH but then I switched to other providers and it didn't. What seems to work on all VPS's is this:

    http://tech.tiq.cc/2014/08/how-to-automatically-install-updates-on-linux-debian/

    Installing ALL updates (not only security) only seems to work for me if I run "unattended-upgrade" once after having configured everything.

  • I haven't had unattended-upgrades not work for me on the three VPSes I have running Debian.

    I seem to recall apticron not working right on a couple of them, but that was due to /etc/cron.daily/apt being not set to executable.

    Thanked by 1lainme
Sign In or Register to comment.