User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: "Reboot required" notification needed

Wed Aug 05, 2020 8:58 pm

GlowInTheDark wrote:
Wed Aug 05, 2020 8:24 pm
As long as you don't mind all the time and bother getting everything (all your processes and such) running again after the reboot...
You mean you haven't set up all your essential services to auto start at boot time? If you can't even handle a planned reboot, how on earth do you cope with an unplanned reboot?

I know I've always set up all my systems to restart cleanly from whatever cause.
Unreadable squiggle

GlowInTheDark
Posts: 744
Joined: Sat Nov 09, 2019 12:14 pm

Re: "Reboot required" notification needed

Wed Aug 05, 2020 10:13 pm

I believe the operative phrase here is:

Totally missing the point.


for $200, Alex.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

jbudd
Posts: 1446
Joined: Mon Dec 16, 2013 10:23 am

Re: "Reboot required" notification needed

Fri Aug 07, 2020 8:57 am

It seems obvious that reboot messages should be printed at the end rather than buried in hundreds of lines of output.

Since they aren't, here is an alias command that watches for "reboot" and if it finds it, prints a message at the end:

Code: Select all

alias upgrade='mkfifo fifo
if grep -i reboot fifo
then
echo
echo PLEASE REBOOT NOW
fi & disown
sudo apt -y full-upgrade | tee fifo
rm fifo'
Usage:
sudo apt update
upgrade

User avatar
PeterO
Posts: 5951
Joined: Sun Jul 22, 2012 4:14 pm

Re: "Reboot required" notification needed

Fri Aug 07, 2020 9:15 am

GlowInTheDark wrote:
Wed Aug 05, 2020 10:13 pm
I believe the operative phrase here is:

Totally missing the point.


for $200, Alex.
I believe the operative phrase here is "I don't know how to set up my system properly." !

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Heater
Posts: 16092
Joined: Tue Jul 17, 2012 3:02 pm

Re: "Reboot required" notification needed

Fri Aug 07, 2020 10:27 am

GlowInTheDark wrote:
Wed Aug 05, 2020 10:13 pm
I believe the operative phrase here is:

Totally missing the point.
Quite likely it does. Hardly surprising. I could not make out what point it was you were trying to make either.

Please don't shout with all that extra big font. It does not make any point easier to not miss.

Thanks.
Memory in C++ is a leaky abstraction .

GlowInTheDark
Posts: 744
Joined: Sat Nov 09, 2019 12:14 pm

Re: "Reboot required" notification needed

Wed Aug 12, 2020 6:33 am

It seems obvious that reboot messages should be printed at the end rather than buried in hundreds of lines of output.

Since they aren't, here is an alias command that watches for "reboot" and if it finds it, prints a message at the end:
Or, more simply:

# script -c 'apt-get update' /tmp/update.log
# script -c 'apt-get dist-upgrade' /tmp/upgrade.log

Now, you have usable log files for both commands - that you can grep or whatever you like to your heart's content.

Notes:

1) There are fancier tools than script that I could (and would) have used, but I wanted to keep it simple for presentation purposes. script is basic Unix - doesn't have to be installed or anything.

2) Any solution (such as the alias posted above) that involves things like piping and tee will fall apart if the thing goes interactive - i.e., if it stops to ask questions. script, luckily by design, handles this just fine. Yes, I know that you specified "-y", which should make it non-interactive, but, as has been discussed here at length and is now well-established, using "-y" does not totally prevent interactivity. The upgrade process can still pause and ask questions - and these questions need to be answered by a live, thinking human being; they cannot, in general, be sensibly automated away (even though they have tried - with that "unattended upgrade" thing).
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

bjtheone
Posts: 883
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: "Reboot required" notification needed

Wed Aug 12, 2020 3:03 pm

rpdom wrote:
Wed Aug 05, 2020 5:25 pm
I thought it was:
It has been detect that you moved you mouse. You must reboot now for the changes to take effect
I used to work for Dell. I had a very controlled and locked down Dell laptop, running a standard image. I had two identical docking setups (same monitor, same keyboard, same mouse, same rev of docking station), one in my office at work, one at home. The drill was hibernate and then undock my laptop. About 30% of the time it would gleefully discover a "new" mouse and install the drivers for it, when it was redocked and resumed at the other site. Some days it would discover the one at home, and then discover the one at the office the next morning.

ejolson
Posts: 5477
Joined: Tue Mar 18, 2014 11:47 am

Re: "Reboot required" notification needed

Wed Aug 12, 2020 3:39 pm

bjtheone wrote:
Wed Aug 12, 2020 3:03 pm
The drill was hibernate and then undock my laptop. About 30% of the time it would gleefully discover a "new" mouse and install the drivers for it, when it was redocked and resumed at the other site. Some days it would discover the one at home, and then discover the one at the office the next morning.
My understanding is
  • Adding a mouse makes a laptop into a new computer.
    • Every computer deserves a mouse.
    The difficulty is that this induction goes round and round until someone falls out of their chair or runs out of memory.

    hippy
    Posts: 7911
    Joined: Fri Sep 09, 2011 10:34 pm
    Location: UK

    Re: "Reboot required" notification needed

    Wed Aug 12, 2020 4:40 pm

    Mice installs are interesting but getting somewhat off-topic.

    The main thing I would point out is that my desire for a reboot notification isn't just so that I know when I should reboot, it's also so others are told when they ought to.

    That's to save people wasting time and energy trying to track down and solve someone else's problem which was caused by their not rebooting when they should have, because they weren't aware they needed to, because they didn't get or see any indication they should.

    It can take some time and wasted effort investigating before 'Did you do something which requires a reboot and maybe you haven't?' is twigged as the possible cause of the problem.

    ejolson
    Posts: 5477
    Joined: Tue Mar 18, 2014 11:47 am

    Re: "Reboot required" notification needed

    Wed Aug 12, 2020 4:59 pm

    hippy wrote:
    Wed Aug 12, 2020 4:40 pm
    Mice installs are interesting but getting somewhat off-topic.

    The main thing I would point out is that my desire for a reboot notification isn't just so that I know when I should reboot, it's also so others are told when they ought to.

    That's to save people wasting time and energy trying to track down and solve someone else's problem which was caused by their not rebooting when they should have, because they weren't aware they needed to, because they didn't get or see any indication they should.

    It can take some time and wasted effort investigating before 'Did you do something which requires a reboot and maybe you haven't?' is twigged as the possible cause of the problem.
    Turning it off and then on again is such a common solution, I think most people try a reboot as the first step in solving any computer-related problem.

    At any rate, the message should read

    The modules for the currently running kernel have been recklessly deleted by the update script. A reboot may restore proper functionality assuming the new kernel works. If you have not done so already, please back up all important work.

    GlowInTheDark
    Posts: 744
    Joined: Sat Nov 09, 2019 12:14 pm

    Re: "Reboot required" notification needed

    Wed Aug 12, 2020 8:10 pm

    The modules for the currently running kernel have been recklessly deleted by the update script. A reboot may restore proper functionality assuming the new kernel works. If you have not done so already, please back up all important work.
    This.
    Well said, sir!
    GitD's list of things that are not ready for prime time:
    1) IPv6
    2) 64 bit OSes
    3) USB 3
    4) Bluetooth

    hippy
    Posts: 7911
    Joined: Fri Sep 09, 2011 10:34 pm
    Location: UK

    Re: "Reboot required" notification needed

    Fri Aug 21, 2020 6:10 pm

    Not related to the "update/upgrade" lack of warning but I have tripped myself up again.

    I had been playing with Python 3.9, decided to gamble on a "sudo make install" in the full knowledge that could break things. Did it and "python3 --version" showed it was still on 3.7.3 so I seemed to have dodged that bullet.

    And so I forgot about it, my Python 3 and 'pip3' experiments have continued with no problems. Until "pip3 list" failed today with an odd error message. Seems a re-boot had changed the Python version to 3.9 and broke things but I'd not noticed.

    True, I perhaps should have rebooted after installing 3.9. Even if I had I might not have found the "pip3" problem until today, but I would perhaps have sooner realised I was running 3.9 than believing I was still running 3.7.

    Return to “General discussion”