1

On my Ubuntu VM:

Linux xxxxxxx 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24
21:16:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

to which I am connected over SSH, I am running this command:

sar 1 10000 | awk '{print $9}'  | grep -v aaaa

(strangely) this command doesn’t produce any output (why?) but next thing is even stranger. If I press Control-C while the command is running it is kind of sending Control-Alt-Delete to my server and the server reboots (why?).

root@xxxxxxx:~# sar 1 10000 | awk '{print $9}'  | grep -v aaaa
^Croot@xxxxxxx:~#
Broadcast message from root@xxxxxx 
       (unknown) at 12:01 ...

The system is going down for reboot NOW!
Control-Alt-Delete pressed

thanks for your help.

Best regards Jaor

0

While described situation sounds quite unrealistic it is actually a fact and is caused by a bug in systat, sadc in particular. sar process spawns sadc process.

TL;DR - Interrupting sar before sadc completes it's job makes sadc triggering a reboot.

Solution to this is to update sysstat to a reasonably new version (the fix is from 2014). From the commit it seems this should be fixed in systat 12.1.7 (not sure about this - still this is a fix from over 5 years ago, understood ubuntu 14 is pretty old). https://github.com/sysstat/sysstat/commit/c3de69658006af0e0e3b7746e8646b8b4cdd2860

more details can be found here

http://northernmost.org/blog/sar-rebooting-ubuntu/index.html

UPDATE: as for no results - this is unrelated thing and is caused by the fact that awk by default is buffering it's input - to get results instantly it needs to be invoked as awk -W interactive

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.