Mac: installer runs new Client as daemon via launchd if system is set up to do that.

svn path=/trunk/boinc/; revision=14478
This commit is contained in:
Charlie Fenton 2008-01-07 03:47:56 +00:00
parent 300d3ed48f
commit da0d20c6fb
2 changed files with 14 additions and 3 deletions

View File

@ -111,11 +111,15 @@ David Jan 4 2008
Charlie Jan 6 2008
- Mac Client: more idle time tweaks to allow running as a daemon by
using Mac OS X's launchd mechanism.
- Mac: Update script which sets BOINC up to run as a daemon so it
- Mac Installer: if system is set up to run BOINC Client as a daemon
using launchd, use launchctl to launch newly installed Client as
a daemon.
client/
hostinfo_unix.C
main.C
mac_installer/
PostInstall.cpp
David Jan 6 2007
- web: bug fixes

View File

@ -352,9 +352,16 @@ int DeleteReceipt()
err_fsref = FSPathMakeRef((StringPtr)"/Applications/BOINCManager.app", &fileRef, NULL);
}
if (finalInstallAction == launchWhenDone)
if (err_fsref == noErr)
if (finalInstallAction == launchWhenDone) {
if (err_fsref == noErr) {
// If system is set up to run BOINC Client as a daemon using launchd, launch it
// as a daemon and allow time for client to start before launching BOINC Manager.
system("launchctl unload /Library/LaunchDaemons/edu.berkeley.boinc.plist");
i = system("launchctl load /Library/LaunchDaemons/edu.berkeley.boinc.plist");
if (i == 0) sleep (2);
err = LSOpenFSRef(&fileRef, NULL);
}
}
return 0;
}