You are not logged in.
Pages: 1
Topic closed
Hey,
Pretty self explanatory. I just want to know if there's a command that checks if a reboot is needed.
I've Googled for this and the few results I've gotten are for Ubuntu/RHEL.
Thanks.
Offline
Sometimes an update will tell you in pacman's output that you should reboot.
I think there already was a thread about this on the forums.
Reboot after kernel upgrade.
Offline
Compare the running kernel version to the installed version, and display a message saying "REBOOT NOW" if they're different. This can be easily automated in a script.
Or just watch pacman's output and reboot when you see a kernel upgrade. :-)
Offline
I grepped my pacman log and there's only 5 instances of the word "reboot" in the ~2 years this installation has lasted. As it is, this isn't suited for monitoring purposes.
Also, I checked the forums. Unless I'm missing something, the threads that talk about anything remotely similar are mostly to do with troubleshooting/"How often do you reboot?".
I think the question is still valid. Is there a command that checks to see if a reboot is required? To rephrase, does a kernel (module) upgrade touch a file/variable somewhere that can be checked?
Edit: Yeah. I thought about scripting this. Seemed a little excessive at the time though. I guess that's where I'll go. Thanks.
Last edited by BasioMeusPuga (2013-11-27 14:19:08)
Offline
nvidia packages use https://projects.archlinux.org/svntogit … ges/nvidia
post_install() {
EXTRAMODULES='extramodules-3.12-ARCH'
depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
echo 'In order to use nvidia module, reboot the system.'
}
Offline
There is no command that can tell you when you 'need' to reboot, you have to use common sense.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
My take on tomk's suggestion:
#!/usr/bin/bash
s1=$(pacman -Q linux | sed 's/linux //')
s2=$(uname -r | sed 's/-ARCH//')
if [ "$s1" == "$s2" ]; then
echo OK
else
echo REBOOT
fi
Offline
Whenever the nfs-utils package gets updated, on my configuration, I need to reboot the machine or else shares are not exported. I have tried restarting the indiviual nfs services but only the reboot fixes it. SO... you might wanna add nfs-utils to your list of "REBOOT" packages if this is true for you too.
A related thread: https://bbs.archlinux.org/viewtopic.php?id=173341
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
A related thread: https://bbs.archlinux.org/viewtopic.php?id=173341
Thanks. For some reason I thought I was subscribed to this thread but I wasn't.
There's also e.g. https://bbs.archlinux.org/viewtopic.php?id=141095 dealing with the "do I really have to reboot after kernel upgrade?" question.
Offline
My take on tomk's suggestion:
#!/usr/bin/bash s1=$(pacman -Q linux | sed 's/linux //') s2=$(uname -r | sed 's/-ARCH//') if [ "$s1" == "$s2" ]; then echo OK else echo REBOOT fi
Almost exactly what I use, except that you need to accommodate 3.x kernels e.g. 3.12 - in that case, s1 will be 3.12 but s2 will be 3.12.0.
Last edited by tomk (2013-11-27 17:10:13)
Offline
[[ $(pacman -Q linux | cut -d " " -f 2) > $(uname -r) ]] && echo reboot
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
[[ $(pacman -Q linux | cut -d " " -f 2) > $(uname -r) ]] && echo reboot
String comparison does not work well with version number. "6.10.1.arch1-1" is lesser than "6.9.10-arch1-1" due to comparison of 3rd character ("1" vs "9").
Hongster
https://tech.mrleong.net
Offline
Perhaps 'vercmp $(pacman -Q linux | cut -d " " -f 2) $(uname -r)' then.
However, this topic is over a decade old. It's unlikely that OP is still looking for a solution.
Closing.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1
Topic closed