needs-restarting alternative on SLES 12?

I’m searching for something that let’s me know whether or not my system would need a reboot (kernel update etc). Red Hat has the yum/dnf plugin needs-restarting, SUSE15 has ported this over as well and it’s available since 15.1. Debian/Ubuntu have the file /var/run/reboot-required and if that exists a reboot is required.

But I couldn’t find anything on SLES 12 that let’s me check this in a script.

The ultimate goal is to build this into our update management with ansible. Updates get installed and if a reboot is required, it’s done as well.

Someone got an idea?

[QUOTE=Raffx;59217]I’m searching for something that let’s me know whether or not my system would need a reboot (kernel update etc). Red Hat has the yum/dnf plugin needs-restarting, SUSE15 has ported this over as well and it’s available since 15.1. Debian/Ubuntu have the file /var/run/reboot-required and if that exists a reboot is required.

But I couldn’t find anything on SLES 12 that let’s me check this in a script.

The ultimate goal is to build this into our update management with ansible. Updates get installed and if a reboot is required, it’s done as well.

Someone got an idea?[/QUOTE]
Hi and welcome to the Forum :slight_smile:
After an update the output from the command zypper ps -s will output if core libraries have been updated and a reboot is required. Dare I say look at the man page for zypper :wink:

There are exit codes;

102 - ZYPPER_EXIT_INF_REBOOT_NEEDED
           Returned after a successful installation of a patch which requires reboot of computer.

The current releases have a file /etc/zypp/needreboot where files that are updated can trigger a reboot request.

Thanks for your reply. I know about zypper ps, but as far as I know this is only for services and doesn’t tell me whether or not a full reboot is required, e.g. for a kernel update.

And about the return code, this is only returned after installation of the package right? So you can’t get that return code again after the installation process (I’m not talking about $?)?. Zypper ps doesn’t give that return code either.

The problem is that the installation happens via the zypper ansible module, which doesn’t let you access the return code of the installation process.

Hi
The only other place I can think of is /var/log/zypper.log and /var/log/zypp/history for a trigger… I’ve not used ansible, but do note in my SuMA instance it does show systems requiring a reboot…