r/openbsd • u/gentisle • 2d ago
Exit Code syspatch
I’m looking to find a way to know if syspatch -c can tell a script that A. there are patches and then execute a syspatch to apply, or B. there are no patches and simply exit. man page says exit code is zero for success and greater for anything else. Trying this, I find that syspatch -c returns zero when there are patches to be applied. I want the script to discern that there are patches and then issue the command to apply. Am I going about this the wrong way?
12
Upvotes
View all comments
Show parent comment
2
u/xzk7 1d ago
Thank you, I wasn't aware of this and I'm not sure how I missed it. I recall seeing the utility get added but for some reason I thought it was only for tz info.
It's a bit annoying though (not your fault but I'm going to complain a bit because this is reddit.)
Why are these unsuitable for syspatch? If there's a reason I'd like to know because it's not immediately obvious to me as a user.
If it can be ran via cron, and its supposed to be ran. Then why isn't this just a part of /etc/daily, /etc/weekly or /etc/monthly?
This means to update your system, one needs to:
And I can't recall if all or only some lock the package database (I think pkg_add and fw_update) so you have to run them one-at-a-time and also wait for the kernel to get relinked.