Apps suddenly can’t be opened

safariSecurityterminal

I had Terminal and TextEdit open, a couple of Finder windows, and possibly another app or two.

This was a few hours after updating to macOS 11.1 (20C69) in case that is the cause.

In Terminal, I did su - Admin to change permissions on a directory with sudo. I forgot to exit before trying to open a new file with TextEdit, so of course I got an error (one account can't open windows in another app's GUI).

Exited Admin and tried again. Got the same error! Quit TextEdit and re-launched—same error!

Restarted laptop and logged in again. Now, Terminal and Safari can't be launched (possibly others). Pop-up appears and vanishes quickly. After several tries, I finally managed to read the first line: "Application (app) interrupted restart."

Switched user to Admin to send this question. Safari & Terminal both functioning on this account.

In the Admin account, interestingly, when tried to use sudo, I was rejected. Did id and found that that the shell (in Terminal launched by admin account) was running my non-admin account!!! Had to su to kill processes (see my answer).

Cause and/or solution?

Best Answer

Still uncertain about cause, but here's one thing that fixed it:

In Terminal, as Admin, I did

sudo kill -9 $(ps -ef | egrep -i "(terminal|safari)" | awk '{print $2}' | sort -nr)

Then shut down. After power on again, things seem to be working properly.