I was fooling around with some applications in my mac (going into contents and trying to change some files, values, etc.)
Of course sometimes I get crashes, but I usually just kill the process and all is good.
This time, though, I could see the application icon in the doc (without the white bar beneath it) but force quit did not help at all.
Going to Application Monitoring did not help, because the app was not listed in there (not with is name, anyway) So, I went to the apple icon on the up - left, click Force Quit, and indeed the app was listed (with its icon) but the name was now "JavaApplicationStub".
Quitting from there did not help either.
I fired up the terminal and checked out all the process
(ps -ax) but neither the app nor "JavaApplicationStub" was listed (not even names close to it).
I tried to logout (and then turn off the mac) but it was no use, since the app was preventing the system from shutting down (incidentally this prevented me to fire up any other app because it would automatically close (the system was trying to shut down after all). Fortunately after a couple of minutes OS X admitted it could not close and gave me the capability to use the system again)
So I was unable to identificate what process to kill.
As last resort, I did a
killall -u myusername and this got me to a grey screen from where I could not do anything. But pressing Cmd + Alt + Esc (the force quit screen) confirmed that the only thing that was running was "JavaApplicationStub".
(this means that either "JavaApplicationStub" was not a process of mine, or that the system was just unable to close that.)
It would still prevent me to shut down, obviously.
Unsure of how I could fire up the usual proframs again from there (Finder, Dock, etc.) I had to hold down the power button for 10 seconds until finally the mac turned off and I could turn it on again.
Now, what was the correct way to handle this situation?
I did something very simple, I just deleted a file (innocent looking one) in the app.contents folder. Is it really this easy to prevent the system to quit an application? Could this be exploited potentially?