Menu
  • HOME
  • TAGS

script runs fine in terminal but not from launchd

python,shell,terminal,environment,launchd

I've tried all that has been mentioned, special thanks to Padraic, but nothing seems to work. It's strange because the script runs perfect when run from the terminal but comes up with errors when run from launchd. I was able to get rid of the errors when run from launchd...

shell script run through launchd not evaluating nested for loop

shell,launchd

I was able to log stderr output to a file using <key>StandardErrorPath</key> <string>/Users/Shared/sillyscript/sillyscript_err.log</string> (source: http://erikslab.com/2011/02/04/logging-with-launchd/) Now I know that the problem is that jq (http://stedolan.github.io/jq/) is not being properly evaluated by launchd. So at least I know what's wrong now, just have to figure out the fix.....

ruby cannot load file when run from LaunchControl?

ruby,watir,watir-webdriver,launchd

actually I managed to find a post/lead that ended up working. The following line added to the beginning of my ruby script made things work: Selenium::WebDriver::Chrome::Service.executable_path = '/usr/local/bin/chromedriver' (not sure if one would view this as the root cause fix, c.f. workaround)...

Start Mac app on startup programatically

osx,launchd

I found the solution Thanks - (void)enableLoginItemWithLoginItemsReference:(LSSharedFileListRef)theLoginItemsRefs ForPath:(NSString *)appPath { // We call LSSharedFileListInsertItemURL to insert the item at the bottom of Login Items list. CFURLRef url = (__bridge CFURLRef)[NSURL fileURLWithPath:appPath]; LSSharedFileListItemRef item = LSSharedFileListInsertItemURL(theLoginItemsRefs, kLSSharedFileListItemLast, NULL, NULL, url, NULL, NULL); if (item) CFRelease(item); } - (void)disableLoginItemWithLoginItems { UInt32 seedValue;...

Auto Start OpenVPN in shell on a Jail Broken iOS device

ios,jailbreak,openvpn,launchd

You're going in the right direction. launchd daemons is the way to go. Several things does not look right in your plist: OnDemand is deprecated, you need to use KeepAlive instead. In your case just set it to true Usually you don't mix Program and ProgramArguments. They basically do the...

Mac OSX 10.9.2, launchd error: “launchctl: Dubious ownership on file (skipping)”

osx,cron,osx-mavericks,launchd

launchd services need to be started by the user who owns the plist file. If the owner is not root, then the service must not be launched with sudo. Also, the permissions on the file must deny write access to all users except the owner. Finally, the file must be...

How should be the launchd file be if I don't want the deamon to load and/or start automatically?

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....

Automatically start Adobe Coldfusion in OS X

mysql,coldfusion,adobe,osx-yosemite,launchd

This is the same issue as MySQL suffers. If you go to: /Library/StartupItems You will see that both ColdFusion and MySQL (if you have it installed) have created startup items - however that functionality has been deprecated by Apple (see Mac Developer Library: Startup Items) so the services do not...

launchd ExitTimeOut doesn't work

osx,timeout,launchd,launchdagent

This is not what ExitTimeOut is for. When unloading a job launchd sends the signal SIGTERM to the process. Should the job not terminate within ExitTimeOut seconds (20 seconds by default), launchd will send signal SIGKILL to force-quit it. launchd has no means to terminate a job after a given...

SQL Alchemy Cannot Open Database File when run as agent

python,sqlite,python-3.x,sqlalchemy,launchd

I found this out. Launch Control and Launchd has a working directory argument. Populating that with the directory of my python project did the trick!

Running a terminal command every hour [closed]

osx,bash,shell,launchd

A couple things could be going wrong here. 1) you need to properly set permissions on your launchdaemon files. Apple's TN2083 (Technote) states: When you install your daemon, make sure that you set the file system permissions correctly. Apple recommends that daemons be owned by root, have an owning group...

At my end with launchd

bash,terminal,launchd

It turns out launchd abandons the sub processes of the script I was trying to run. this is a common problem as it turns out. Found the answer here.

If Launchd does not run today, run alternate command

osx,launchd

I have solved this issue by creating a bash script which checks the time and executes srd with respective parameters: #!/bin/bash NOW=$(date +"%H") echo $(date); if [[ $NOW == 23 ]] then /usr/bin/srd exec --verbose echo "Sifttter grabbed today's events."; else /usr/bin/srd exec -y --verbose echo "Sifttter caught up on...

Python subprocess doesn't work when ran by launchd

python,launchd

Finally figured it out. Somewhere down the line while I was writing this script I enabled the 'Change Picture: Every Day' feature in OSX's System Preferences (I wanted to see if I could find the plist used for this process). Once I finally realized this and disabled it, launchd was...

File.getAbsoluteFile() return “/” in unix shell execution

java,unix,relative-path,launchd

finally I used next way new File(ClassName.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()); I got a path in which the jar is being executed , and then some string's manipulations then it worked ... No the most "elegant" way , but works :)...