launchd

jenkins on Mac, PATH is not set right, no /usr/local/bin

戏子无情 提交于 2019-11-27 21:07:15
问题 I recently installed Jenkins, using Homebrew. I also installed Mercurial using Homebrew. I can successfully clone an hg repo just fine - from Terminal. But if I try and do the same thing as part of a job in Jenkins, it fails. So, in by job, I told Jenkins to run a shell script echo $PATH . Sure enough, the path /usr/local/bin is not there. If I execute the same command from Terminal, it's there. So, what is the best way to modify PATH so that Jenkins is pulling the same PATH that I'm using,

How can you start a LaunchAgent for the first time without rebooting, when your code runs as a LaunchDaemon?

牧云@^-^@ 提交于 2019-11-27 17:01:35
问题 I have a LaunchDaemon. When it runs, it checks if SIMBL is installed. If SIMBL is not installed, it uses NSTask to run /usr/sbin/installer on the SIMBL.pkg. SIMBL's postflight script then tries to run a launchctl load command to start SIMBL's LaunchAgent immediately: sudo -u "$USER" -- /bin/launchctl load -F -S Aqua -D user "${LAUNCHD_PLIST}" This fails, because my LaunchDaemon's NSTask environment doesn't have $USER set. If I have my daemon detect the current user with the System

What's a clean way to stop mongod on Mac OS X?

落爺英雄遲暮 提交于 2019-11-27 09:01:04
问题 i'm running mongo 1.8.2 and trying to see how to cleanly shut it down on Mac. on our ubuntu servers i can shutdown mongo cleanly from the mongo shell with: > use admin > db.shutdownServer() but on my Mac, it does not kill the mongod process. the output shows that it 'should be' shutdown but when i ps -ef | grep mongo it shows me an active process. also, i can still open a mongo shell and query my dbs like it was never shutdown. the output from my db.shutdownServer() locally is: MongoDB shell

SMJobRemove succeeds, but plist and helper tool not deleted

荒凉一梦 提交于 2019-11-27 07:09:30
问题 I'm trying to remove a privileged helper tool installed via SMJobBless , I'm getting a positive return value and no errors, yet the files at /Library/PrivilegedTools and /Library/LaunchDaemons are not deleted. Do I have to delete these files myself? From the documentation I read: Return Value true if the job was removed successfully, otherwise false. I'm calling the following to remove the job: result = SMJobRemove(kSMDomainSystemLaunchd, (__bridge CFStringRef)label, _authRef, YES, &errorCF);

How to limit memory of a OS X program? ulimit -v neither -m are working

元气小坏坏 提交于 2019-11-27 00:57:14
My programs run out of memory like half of the time I run them. Under Linux I can set a hard limit to the available memory using ulimit -v mem-in-kbytes. Actually, I use ulimit -S -v mem-in-kbytes, so I get a proper memory allocation problem in the program and I can abort. But... ulimit is not working in OSX 10.6. I've tried with -s and -m options, and they are not working. In 2008 there was some discussion about the same issue in MacRumors , but nobody proposed a good alternative. The should be a way a program can learn it's spending too much memory, or setting a limit through the OS. After

Starting/stopping a launchd agent for all users with GUI sessions

故事扮演 提交于 2019-11-26 23:10:17
问题 I need to be able to start/stop a per-session GUI agent from a root level daemon. Similar issues are discussed here, here and here. What I want to be able to do is basically for num in `ps ax | grep [s]bin/launchd | cut -c 1-5`; do if [ $num -ne 1 ]; then sudo launchctl bsexec $num launchctl (un)load -S Aqua /Library/LaunchAgents/com.mycompany.mydaemon.plist; fi; done but this only starts/stops one instance and it runs as root in the current GUI session. If I leave the sudo off there start I

Missing certificates and keys in the keychain while using Jenkins/Hudson as Continuous Integration for iOS and Mac development

谁说胖子不能爱 提交于 2019-11-26 15:09:27
I'm trying to improve Hudson CI for iOS and start Hudson as soon as system starts up. To do this I'm using the following launchd script: <?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>Hudson CI</string> <key>ProgramArguments</key> <array> <string>/usr/bin/java</string> <string>-jar</string> <string>/Users/user/Hudson/hudson.war</string> </array> <key>RunAtLoad</key> <true/> <key>UserName</key> <string>user</string> </dict> </plist> This works OK