Artix Linux Forum

Artix Linux => Applications & Software => Topic started by: dpx on 02 August 2025, 23:15:25

Title: Report after upgrade
Post by: dpx on 02 August 2025, 23:15:25
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.
Title: Re: Report after upgrade
Post by: metwo on 03 August 2025, 07:54:50
I've not had to manually restart a service after upgrading with Pacman, usually 'it just works'.
Title: Re: Report after upgrade
Post by: dpx on 03 August 2025, 10:21:05
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.
Title: Re: Report after upgrade
Post by: gripped on 03 August 2025, 14:20:11
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.


Title: Re: Report after upgrade
Post by: dpx on 03 August 2025, 16:59:34
/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.
Title: Re: Report after upgrade
Post by: gripped on 03 August 2025, 17:17:57
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