On OS X the auto-restart procedure involves creating a
plist file that will allow OSX to monitor Corrade and restart in case of failure.
This example uses the following placement of files on an OS X system. You can modify the paths as you see fit but remember to change the paths in the
org.grimore.corrade.plist file in the code section as well.
+------+ | root | +--+---+ | +-----+ usr | + | | | +--+ local | + | | | +--- opt | + | | | +--- Corrade | + | +- Corrad.exe | +- Corrade.ini | + +-----+ System . + . | . +----- Library + | +------ LaunchDaemons + | +--------- org.grimore.corrade.plist
On OS X there are two possible locations where you could create the
plist file. The first option would be to place the file in:
in which case Corrade will start when the user logs-in. This may be convenient if you only want to run Corrade when you are logged-in to your account on OS X. In fact, once you place the
plist file in
~/Library/LaunchAgents there is a nice third-party utility called LaunchRocket that installs as a preference pane and will allow you to switch Corrade on and off with the push of a button from the interface.
The other variant in case you want Corrade to start at bootup and run regardless if a user is logged-in or not is to place the
plist file in the directory:
by placing the
plist file in
/System/Library/LaunchDaemons Corrade will start automatically when the machine boots up.
plist file has been placed in either locations, you can either use
LaunchRocket to start the service (in case you placed the
plist file in
~/Library/LaunchAgents) or you can attempt to start Corrade from the terminal (
In order to start Corrade, you would execute:
launchctl load /System/Library/LaunchDaemons/org.grimore.corrade.plist
conversely, to stop Corrade, you would execute:
launchctl unload /System/Library/LaunchDaemons/org.grimore.corrade.plist
When Corrade starts up, you can issue from a terminal:
ps ax | grep Corrade
which should display two lines:
56759 ?? Ss 0:48.83 /Library/Frameworks/Mono.framework/Versions/4.2.2/bin/mono /Library/Frameworks/Mono.framework/Versions/4.2.2/lib/mono/4.5/mono-service.exe /usr/local/opt/Corrade/Corrade.exe 56884 s002 S+ 0:00.00 grep Corrade
where only the first line is relevant and shows
Corrade.exe - this means that Corrade is running.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>org.grimore.corrade</string> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> <key>ProgramArguments</key> <array> <string>/usr/local/bin/mono-service</string> <string>--no-daemon</string> <string>/usr/local/opt/Corrade/Corrade.exe</string> </array> <key>WorkingDirectory</key> <string>/usr/local/opt/Corrade</string> </dict> </plist>