RLT
RLT

Reputation: 4287

Get notified when a process or application is killed/forcekilled?

I am trying to monitor if certain application has killed, crashed, force killed on system. How can I get such notifications on Mac.

What is the common approach to implement such design?

Thank you

Upvotes: 3

Views: 1256

Answers (2)

Roy Truelove
Roy Truelove

Reputation: 22456

I believe the common approach, although probably not exactly what you're looking for, is to periodically poll your processes. For instance:

ps -A | grep 'someIndentifingString'

If this doesn't return anything, your process is gone.

This won't, though, tell you if it was caused by a crash, force kill etc., so I'm not sure that it completely meets your needs.

Upvotes: 0

Related Questions