ThatGuyB's rants

For people who follow me for Void tips and tricks, I knew of xcheckrestart utility from the xtools package for a long time, but always forgot to use it. Here’s the deal. Void doesn’t automatically restart services or programs once you update them via the package manager, Void allows you to update, then schedule a restart at any point you want.

This has the advantage of saving an admin time, instead of spending a lot of time updating software, an admin can just update the software and only schedule a 10 minute downtime once the update is finished to restart services. And to discover what services are running that are using the older version, you use xcheckrestart.

I just updated my grafana (7.1.5 → 8.3.3), prometheus (2.28.1 → 2.33.1), openssh and openntpd servers and thought that it’s a good time to use this tool. I saw that grafana, prometheus and openssh were being updated, but I didn’t know openntpd got updated too, which was interesting. Following that, I just used doas sv restart grafana and the rest of the services and was up and running again. Reusing xcheckrestart only showed sshd needing a restart, but that’s because I was still in the session. Disconnected and reconnected and the xcheckrestart did not present any other program that needed restart other than udev (eudev), but that requires a full OS restart, so I’ll leave that for now.

xcheckrestart was run as root (with doas) because those services were running as root. But the tool can and it is recommended to be run under an unprivileged user, but that won’t show the processes that are running under root user that need to be restarted. xcheckrestart can be used when, for example, you update firefox while it is still running and you don’t know if you need to close and relaunch firefox. So after an update, you can run xchecktool on your user and see if you need to close and reopen any programs, or under root to check if you have any services that need to be restarted.

Pretty nifty tool, I’m not sure how Ubuntu, Debian, OpenSUSE or Fedora does this, except with restarting the server just to be sure, or the admin taking a note of what pieces of software are getting updated and doing a manual restart. Of course, there could be some software out there that may restart automatically through scripts ran from the package manager.

I do remember GitLab restarting automatically after a yum update, but needing a gitlabctl reconfigure to apply the changes after the update. Speaking of GitLab, yeah, when I was a sysadmin, running mostly CentOS and OEL, when I had to update some critical infrastructure, like GitLab or Jira, I had to take my time to schedule the maintenance window, update the software via the package manager or downloading the binaries, then restarting the service. Seems like my home servers are way better at maintenance windows and saving my time than my production ones, lol.

I mean, if I was running Void in production, I would just do updates whenever Ii wanted, use xcheckrestart to see if there are any services that need restart, then schedule a maintenance window when I could remote into the servers and restart. It would probably take 10 minutes, instead of 30 min to 1 hour, if everything went smoothly, that is. But then, I’d be running Void in production, so…you get the point.

While I am comfortable running Void on my personal servers and on basically anything, I probably wouldn’t be so willy-nilly to do it on a production server at a company I work for. I doubt it would be too bad, but I wouldn’t like to take my chances. I would however run Alpine in production in a heartbeat if I’d have the opportunity, just because Alpine is just so much smaller than Void. But then again, the only reason I ran CentOS, Ubuntu or Debian was because most software I needed were either in the main repo or EPEL, or adding a repo was really easy, so I could update everything at once via the package manager. Void has a wild selection of programs right in its main repo, but if something isn’t available in there, you’re basically out of luck, you have to either compile it manually, or use xbps-src and do your own templates to compile, which defeats the purpose. Alpine has even less software selection.

1 Like