Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Restart a Crashed App Automatically?

Restart a Crashed App Automatically?
Thread Tools
Junior Member
Join Date: Feb 2005
Location: Las Vegas, NV
Status: Offline
Reply With Quote
Aug 11, 2006, 11:23 AM
 
We havea few servers running apps that should be ran all the time. Sometimes they'll crash and we'll get an alert and have to take over the machine to restart the app. It'd sure be nice to have some software that will check to be sure that an app is always running and if it is not running then it will start the app up automatically.

Does anyone have any suggestions on software that can do this?
Macminicolo.net - Your mini. Our data center. The perfect low-cost server.
     
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Aug 11, 2006, 11:28 AM
 
Applescript or a shell script will work.

in a shell script, just do
Code:
#!/bin/sh while [ 1 ]; do /path/to/application.app/Contents/MacOS/appname sleep 5 done
That will launch the app, and if the app crashes, pause five seconds, then launch it again. To stop the loop, hit control-C in the terminal window used to run the script.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:45 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2