I have a web app that crashes from time to time and I was looking for a way to detect the crash from the Mac terminal and restart the web server. Currently, I have a simple Applescript routine that I can run to kill the process and restart the terminal/web app, but I need a way to detect the crash from the terminal. When a failure occurs, a message will appear in the terminal and I was hoping to simply sense the change in text and initiate the applescript routine.
That’s what I was thinking. I recommend the app LaunchControl to create and manage them, and launchd has an option to relaunch an app if it quit improperly.
But only if this is a standalone app running on a Mac.
Yes, more than true with regards to finding/fixing the root issues. However, without diving into the details, fixing the issues (not related to the WebApp itself) will be significantly more difficult to resolve I believe. Thanks