I have mainly two accounts on my 14.10 laptop: Mine (admin) and my brother's (restricted).
Now when my brother is logged in and runs some applications like firefox with flash player, it consumes much CPU. I have an Intel 2GHz, 2 cores, but with software rendering because of half-broken graphics card.
When he now locks his account and I log into mine, CPU is at about 80% even if I do nothing. indicator-multiload
shows firefox and compiz of the other user as most consuming processes, sometimes xorg too, I think.
So in a nutshell: Can I run a command/script to pause the processes started by another user and resume them again after I have done my work? Would be nice if that could be executed at every locking/login/logout.
But is this safe for all applications? Where do I have to pay attention?
Best Answer
One way would be to send the
SIGSTOP
signal to all of your brother's processes:To awaken the stopped processes, the
SIGCONT
signal is used:You can use an Upstart session job, one which would run when you logged in or out or locked or unlocked your screen. For example, create a
.conf
file in~/.config/upstart
(say~/.config/upstart/stop-brother.conf
) containing:And a converse file (say
~/.config/upstart/start-brother.conf
) containing:You also need a
NOPASSWD
entry insudoers
:Now the signals should be sent automatically when you log in, log out, lock or unlock the screen. You can manually initiate either using: