When I run Zotero/Firefox, they often crash and I am left with zombie processes; after this I cannot open new instances of Zotero or Firefox. I want to get rid of these zombie processes rather than rebooting, so for <pid> of the zombie process,
$ ps -p <pid> -o ppid=
gives me the <parent_pid> and
ps aux | awk -v PID=<parent_pid> '$2 == PID {print $0}'
tells me the parent process is /sbin/launchd for user crippledlambda.
Is there a way to restart this without killing my system?
sudo kill -1 <parent_pid>
does nothing. I've tried writing this in a script and running it with sudo:
for i in `launchctl list | grep launchd | awk -v PID=<parent_pid> '$1==PID { print $NF }'`; do `launchctl stop $i && launchctl start $i` ; done
and this obviously(?) leaves me with an unresponsive gray screen so I have to reboot anyway. Thanks in advance for your suggestions.