Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Report after upgrade (Read 708 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Report after upgrade

I have some Hetzner VM doing nothing and since they support very few distros out of the box I went initially with Ubuntu. I can't stand the thing and will replace it soon but there is one nicely done bit: after sudo apt-get upgrade it shows nice overview of actions caused by the upgrade:

Code: [Select]
Pending kernel upgrade!
Running kernel version:
  6.8.0-63-generic
Diagnostics:
  The currently running kernel version is not the expected kernel version 6.8.0-71-generic.

Restarting the system to load the new kernel will not be handled automatically, so you should consider rebooting.

Restarting services...
 systemctl restart multipathd.service packagekit.service polkit.service rsyslog.service ssh.service

Service restarts being deferred:
 /etc/needrestart/restart.d/dbus.service
 systemctl restart [email protected]
 systemctl restart [email protected]
 systemctl restart systemd-logind.service
 systemctl restart unattended-upgrades.service

No containers need to be restarted.

User sessions running outdated binaries:
 dx @ session #1: ssh-agent[1086]
 dx @ session #5707: sshd[381788,381867], tmux: server[381922]
 dx @ user manager service: systemd[974]

No VM guests are running outdated hypervisor (qemu) binaries on this host

Is there anything similar for pacman to show what needs restarting? When I install Artix on server I would love to have report like this.

Re: Report after upgrade

Reply #1
I've not had to manually restart a service after upgrading with Pacman, usually 'it just works'.
HP Z640 - 72 x Intel Xeon E5-2699 v3 @ 2.30GHz, 128 GiB RAM, 4GiB + 32GiB NVIDIA

Re: Report after upgrade

Reply #2
I've not had to manually restart a service after upgrading with Pacman, usually 'it just works'.

I noticed that cronie gets restarted with pacman upgrade, at least messages say so. Rest of the services seem to keep using whatever binaries were already loaded so while you can keep running that way it is not super clean. If you don't reboot for 100 days, server keeps using packages 100 days obsolete if they are already in use, not perfect for a server.

Re: Report after upgrade

Reply #3
I noticed that cronie gets restarted with pacman upgrade, at least messages say so
This is handled by libalpm (pacman) hooks.
If you look at the cronie one
/usr/share/libalpm/hooks/80-cronie.hook
you'll see that cronie gets restarted when ever glibc gets updated.
Spoiler (click to show/hide)

You can override the system installed hooks by creating one with the same name in
/etc/pacman.d/hooks
and you can also add your own in there.

It would be fairly trivial to create hooks for the services you wish to restart any time they are upgraded.
I name them zzz-* when I want them to happen last.



Re: Report after upgrade

Reply #4
/usr/share/libalpm/hooks/80-cronie.hook

Thanks, looking at .../hooks and .../scripts there is plenty of interesting examples to follow. Maybe overkill to try to cover all in advance but super useful to secure few services after the initial setup. Perfect.

 

Re: Report after upgrade

Reply #5
Thanks, looking at .../hooks and .../scripts there is plenty of interesting examples to follow. Maybe overkill to try to cover all in advance but super useful to secure few services after the initial setup. Perfect.
Yeah simple but powerful.

One thing to bear in mind is to always use the full path to programs after Exec = as I seem to remember getting confused why my hook wasn't working without the full path.

I use them to patch and recompile select packages on upgrade