I'm on ubuntu 16.04 unity latest updates installed, I have one of the best Asus gaming laptops in the market, VLC is installed but I never use it.
For the last few months, I wasn't able to shut down my PC, every time I try to do so, the fans start spinning so fast and it hangs, so I just press the shut down button, that problem was only on shutdown, not restart I didn't even bother trying to solve the problem.
Today, while I was working, I noticed the fans doing the same thing that they normally do while shutting down. I ran top
noticed 2 vlc instances being run under my username consuming like 122% cpu each, although again I don't use vlc, and I'm not using any program that relies on vlc.
I tried to sudo kill <pid>
and sudo killall <pid>
and sudo killall vlc
but still they weren't killed, that never happened to me before. I killed them from Ubuntu resource monitor, they were killed and the shutdown problem was fixed, and everything went back to normal.
Did that happen to anybody before?
ps aux | grep " $(echo -n $(pgrep vlc | xargs ps -o ppid | tail -n +2 | tr -d ' ') | sed 's/ / \\| /g') "
next time it happens. This would find all running instances of VLC, get the parent PIDs for each of them, and then search for the parent PIDs in the output ofps aux
. It might help in tracking down the problem. – anonymoose Jan 06 '19 at 16:29xargs
runs its command with no arguments if it doesn't receive any input, and sincepgrep vlc
prints nothing when VLC isn't running, it runsps -o ppid
, which lists the PPIDs for all the processes in the current terminal, and then it searches for them in the output ofps aux
. The command is pretty hacky anyway (please don't use it in a script!), so I'm not going to try and fix it. It should work when VLC is running. – anonymoose Jan 06 '19 at 17:00sudo kill -9 <pid>
would probably have worked where justkill
didn't. The-9
means "Kill anything that moves, with extreme prejudice, in the most gruesome way possible". Not much can survive it. Without-9
, it's more like "Please die? Please, pretty please with a cherry on top?" – trysis Jan 06 '19 at 17:18kill -9
, it's dangerous. If for example the application has created a temporary file under/var/lock
, it won't be removed. Similarly, buffers won't be flushed, database transactions will not be committed, etc. You could end up with corrupt or missing data if anything was being written anywhere. VLC is probably not doing any of those things, but I would recommend trying to understand the problem before assuming. – Kevin Jan 06 '19 at 18:19