How to tell when to reboot afer updating when doing so remotely??

Asked by tearsforhari

Hello--How do I tell when I need to reboot afer updating remotely?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
tearsforhari
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Use the command:

last | less

It shows login times and when then system rebooted. It also shows logoff times.

As long as you have not cron'd a reboot, you will know who rebooted the system.

Revision history for this message
tearsforhari (tearsforhari) said :
#2

Thank you actionparsnip. Useful command to know, indeed. But my question was rather when is it necessary to reboot the OS after performing an apt-get upgrade? I read online that there will be a glowing red icon, suggesting that a reboot is necessary for say updating a kernel. In most cases, there is not a need. I need to know if there is a way to tell remotely by command prompt?

Since you brought up cron'd, can you provide me a script to reboot in the early morning hours?

I appreciate your efforts.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

You only really need to reboot to boot to a newly installed kernel. Kernel 4.0 is taking steps to remove this so reboots will be a thing of the past. Otherwise you can run the system indefinitely and be fine. Linux is geared around uptime.

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

AFAIK if a reboot is required for activating a new kernel, or core package like dbus, then a file /var/run/reboot-required is created.

So you could test for the presence of
/var/run/reboot-required
and eventually
/var/run/reboot-required.pkgs
(the latter shows the names of the packages that require the reboot)

Revision history for this message
tearsforhari (tearsforhari) said :
#5

Yes, indeed. Last night, one of the boot up messages was that a restart is required. So I rebooted. Checking /var/run this morning, there were no files of that nature. However, there are new security updates that also appeared this morning. After doing an apt-get dist-upgrade, those files reboot-required and reboot-required.pkgs in /var/run appeared. Thank you.

I see a crond.reboot file in the /var/run. But it is empty. What is this for?