Regular pivpn reboot for updates?

Commissario
Joined
16 Oct 2002
Posts
343,990
Location
In the radio shack
I've just rebuilt my old, openVPN Pi with a spanky new install of pivpn on Bullseye. Oh, that was so much easier than when I set it up originally back in 2017 and it allows me to specify my Pihole as the DNS server. Fantastic. It's all working well and the Wireguard client seems to connect a lot faster than the openvpn one did.

As part of the install, one of the questions it asked was about automatic updates. Naturally I said yes because I figured I should go from zero updates and Raspbian Jessie to keeping it updated properly. It also said something about needing to reboot regularly to apply updates. At least, that's what I thought it said, I sort of just nexted past it without reading it properly.

Is that correct? Should I schedule a monthly reboot of my PiVPN RPi?
 
I'd imagine it's part of the regular Linux OS updates, for example if a new kernel is released it needs an update.
I wondered that but surely it would have actually said if that was the case. I can cron an apt-get update and apt-get upgrade -y before the reboot.

/edit - Ahh, I wonder if it's installed unattended-upgrades as part of the pivpn install.

/edit2 - Yes, yes it does.
 
Last edited:
I wondered that but surely it would have actually said if that was the case. I can cron an apt-get update and apt-get upgrade -y before the reboot.
Just apt is fine, you don't need to put apt-get since about something like 5 years now. :D

Not sure mate, check their documentation maybe?
 
Yeah, I've got so used to typing apt-get that it's just automatic and I keep forgetting not to!

Right, it's not really mentioned in the pivpn documentation but I can see it has installed unattended-upgrades.

I've just tweaked the config file, I think this should do it.

Code:
// Automatically reboot *WITHOUT CONFIRMATION* if
//  the file /var/run/reboot-required is found after the upgrade
Unattended-Upgrade::Automatic-Reboot "true";

// Automatically reboot even if there are users currently logged in
// when Unattended-Upgrade::Automatic-Reboot is set to true
//Unattended-Upgrade::Automatic-Reboot-WithUsers "true";

// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately
//  Default: "now"
Unattended-Upgrade::Automatic-Reboot-Time "04:15";

So it will do a reboot at 04:15 if there are updates that need it.

Hopefully this is sorted.
 
Just a bump to say that this is working as intended, it seems to be keeping the Pi up to date with both regular updates and rebooting at 04:15 when there's a kernel update that needs to be applied.
 
Back
Top Bottom