PDA

View Full Version : ssh gdm and gnome-shell cpu-hog



rholme
20th August 2016, 02:51 PM
I logged into another Unix machine where I started a LONG running job as root after SU from a terminal window under Cinnamon.
nohup bla_bla &

Then I logged out of the remote machine. SSH just hung around wwith "logout ...." so I removed the shell by clicking on the X in the right corner and telling it to let it die (despite things running).

After that, my two cpu system seemed to be VERY slow so I looked. Top showed gdm (whatever that is) using 80-95% of a CPU and gnome-shell using another 80-90% of a CPU.

I rebooted to fix the problem. The long running job is running fine on the other system.

Is this behavior expected? (Or is this another problem from something else).
a) will SSH not disconnect if there is a BG process (even if was done by root using su and a sub-shell??
b) will me rudely terminating the TERMINAL session which had the SSH in it cause gnome to go crazy??

Running Fedora 24 with Cinnamon, fully patched this morning BEFORE running above.

Thanks in advance for shedding light.

ocratato
20th August 2016, 03:23 PM
A common programming error gets results like you describe.
If a process waits for data (eg on a socket) but instead gets a notification that the stream has been closed it can mis-interpret the return code as simply getting zero bytes of data and resumes waiting only to be immediately notified of the closure - repeat very quickly.

The gdm program is the program that provides the graphical login. It appears to be parent process of most things in a graphical session.

My guess is that by closing the terminal window you effectively closed a stream that gnome-shell and gdm were listening on and did not expect to be closed.

rholme
20th August 2016, 04:11 PM
Many thanks. I understand better now.

marko
20th August 2016, 04:44 PM
Another tip, I used to use "nohup <cmd> &" but found it's much more reliable to use 'at'

to just start the job right now:

$> at now
warning: commands will be executed using /bin/sh
at> <type in job command>
<press Cntrl+d>or at some particular delay from now


$> at now + 1 hour
warning: commands will be executed using /bin/sh
at> <type in cmd here>
<press Ctrl+d>
for 'at' jobs to work, 'atd.service' needs to be activated in systemd

rholme
21st August 2016, 05:08 PM
Thanks for the AT tip!