mysql,osx-mavericks,launchd,launch-daemon
Change your KeepAlive key to <key>KeepAlive</key> <dict> <key>AfterInitialDemand</key> <true/> <key>Crashed</key> <true/> <key>SuccessfulExit</key> <false/> </dict> This will restart your job when mysqld has crashed or terminated with an error code. The AfterInitialDemand subkey makes sure the job is not started when loaded....
Use SCDynamicStoreCopyConsoleUser to get the console user name. CFStringRef consoleUserName = nil; uid_t uid; gid_t gid; consoleUserName = SCDynamicStoreCopyConsoleUser(NULL, &uid, &gid); Store consoleUserName in some member variable. Now creates a session to interact with the dynamic store maintained by the System Configuration server using SCDynamicStoreCreate SCDynamicStoreRef store; CFStringRef key; CFArrayRef...