launchd

How to check if launchd has started the script?

可紊 提交于 2019-11-30 12:49:52
问题 I configured the launchd to start a command at 18pm every day on my mac pro,but it was not working. I want to check if the launchd has run the command. I tried the system console, found no anything valuable. my mac os version is mac os x 10.8.3 My plist file: <?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>mytask</string> <key>Program</key>

setenv variable with spaces in launchd.conf?

本秂侑毒 提交于 2019-11-30 12:43:58
I'm a Linux user that just recently got a mac. I'm trying to set up my IDE and found out that Macs don't use .bashrc / .bash_profile / etc. for GUI apps. So, if you have a GUI app that needs an environment variable, you're apparently supposed to do it in /etc/launchd.conf The thing is, this file uses csh style setenv syntax ("setenv key value" instead of "export key='value'") so now that I have a variable that has a space in it, I don't know what to do. Nothing is working. This is what I've tried to test it: setenv MAVEN_OPTS "-Xms512m -Xmx1024m" setenv MAVEN_OPTS1 '-Xms512m -Xmx1024m' setenv

How to check if launchd has started the script?

谁说我不能喝 提交于 2019-11-30 03:03:31
I configured the launchd to start a command at 18pm every day on my mac pro,but it was not working. I want to check if the launchd has run the command. I tried the system console, found no anything valuable. my mac os version is mac os x 10.8.3 My plist file: <?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>mytask</string> <key>Program</key> <string>/opt/local/bin/node</string> <key>ProgramArguments</key> <array> <string>/Users/xxx/My/task.js<

VERY simple Launchd plist not running my script

血红的双手。 提交于 2019-11-29 22:16:43
I'm trying to figure out why my launchd script is not working. It is extremely simple, but I am new to the mac environment and trying to get accustomed. Here's my plist. I know ProgramArguments is required, so I just put the script path in there. <?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>com.tomcat.plist</string> <key>ProgramArguments</key> <array> <string>/opt/apache-tomcat-5.5.27/bin/startup.sh</string> </array> <key>OnDemand</key> <false/>

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

我与影子孤独终老i 提交于 2019-11-28 22:33:51
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, when I echo it from Terminal? Note, Jenkins is running from the same user account that I'm logged into

VERY simple Launchd plist not running my script

混江龙づ霸主 提交于 2019-11-28 19:45:42
问题 I'm trying to figure out why my launchd script is not working. It is extremely simple, but I am new to the mac environment and trying to get accustomed. Here's my plist. I know ProgramArguments is required, so I just put the script path in there. <?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>com.tomcat.plist</string> <key>ProgramArguments</key>

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

风格不统一 提交于 2019-11-28 15:08:19
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 version: 1.8.2 connecting to: test > use admin switched to db admin > db.shutdownServer() Tue Dec 13 11

SMJobRemove succeeds, but plist and helper tool not deleted

浪子不回头ぞ 提交于 2019-11-28 12:26:07
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); Thanks jatoben , that thread had the answer I was looking for. As suspected you do have to remove the

Schedule multiple, daily events with NSTimer?

限于喜欢 提交于 2019-11-28 06:33:57
问题 I have a schedule cache stored in an NSDictionary . For the example below, I have a schedule time of January 13, 20120 2:00PM and January 13, 2012 2:05PM . How can I add both of these to a queue to fire on their own? Build the Schedule Cache: -(void) buildScheduleCache { NSCalendarDate *now = [NSCalendarDate calendarDate]; NSFileManager *manager = [[NSFileManager defaultManager] autorelease]; path = @"/var/mobile/Library/MobileProfiles/Custom Profiles"; theProfiles = [manager

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

喜欢而已 提交于 2019-11-27 22:20:47
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 get task_for_pid() (os/kern) failure Couldn't switch to new bootstrap port: (ipc/send) invalid port