Launchd is a process management daemon, similar to "init". It is commonly used on Darwin-based systems.
Questions tagged [launchd]
640 questions
6
votes
2 answers
How to programmatically run a command with low IO priority and high niceness value on OS X
Is there a way to basically call system(), but with a predefined niceness value (20) and low IO priority from Objective-C?
(The low IO priority setting I'm talking about is the one launchd has)
I'm trying to launch /usr/bin/purge from within my…

houbysoft
- 32,532
- 24
- 103
- 156
6
votes
7 answers
How can I make a program start up automatically in OSX?
I have a little program that I want to make open automatically when my mac is started up.
Because this program accepts command line arguments, its not as simple as just going to System Prefs/Accounts/Login items and adding it there...
From google, I…

Matt Roberts
- 26,371
- 31
- 103
- 180
6
votes
1 answer
launchd: WatchPaths will not trigger simple "hello world" script (OS X 10.8)
having a strange issue here. I have ~/Library/LaunchAgents/com.me.helloworld.plist with the following contents:

user1940620
- 63
- 1
- 3
6
votes
3 answers
How can I add arguments to OSX launchd plist to pipe output to a log file?
I have tried many different variation on this but just can't get it to work.
I have a plist file:

ilium007
- 539
- 3
- 8
- 17
6
votes
2 answers
Location services in a command line program on Mac OS
I wrote a simple program, which uses the Cocoa location services to get the user's current position. It works without a problem on a MacBook Pro. However, it does not on a MacBook Air.
I am left with a Operation could not be completed.…

az4dan
- 651
- 2
- 10
- 30
6
votes
1 answer
Opening application via ssh on iOS devices
I have seen ways to open applications on linux and Mac devices but can't seem to get the same idea working for iOS devices.
I have jailbroken my device and have ssh access and would like to open an app without having to visit the device?
This idea…

Chemrep
- 63
- 1
- 1
- 5
5
votes
0 answers
Using keychain inside a launchd system daemon
We have a launchd daemon that stores usernames and passwords from inside the keychain. It works when we try to add (with SecKeychainAddGenericPassword) remove (with SecKeychainFindGenericPassword and SecKeychainItemDelete) but we are unable to get…

Marc-Etienne
- 51
- 1
5
votes
1 answer
running a shell script automatically with launchd on Mac
I'm trying to get a script to run every day at the same time to restart a Mac. I cannot use the built in schedule feature in the energy saving preference panel because I have apps running that prevent a normal restart. If I initiate the restart via…

Erithacus
- 51
- 1
- 1
- 5
5
votes
0 answers
Convert systemd service script to launchd service script
I have a systemd service script which I would like to convert to a launchd service script to use for macOS. How would I approach this?

Marwi
- 153
- 2
- 11
5
votes
2 answers
launchd executes python script, but import fails
I wrote a python script using appscript to track my currently active window. I am running it via launchd, but when I do that it can't import appscript. I have set the PYTHONPATH in the plist for launchd, but I think launchd is not reading .pth…

katy lavallee
- 2,741
- 1
- 28
- 26
5
votes
2 answers
NSNotification to detect other program's crashes
I was planning on writing a small daemon that detected whether another app crashed, thinking all the while that the system would send an NSWorkspaceDidTerminateApplicationNotification, but this is not the case.
Assuming that I do not want to create…

Andrew J. Freyer
- 591
- 2
- 12
- 38
5
votes
0 answers
Launch Agent Error Code 127
I have a plist that is supposed to run a shell script, the shell script has been chmod +x /path/to/myscript and I have checked that it runs properly. Below is my plist:
Label
…

Patrick Cook
- 458
- 12
- 27
5
votes
1 answer
Cannot set custom $PATH for Qt Creator on OS X 10.10
I use Qt Creator with custom build system (ninja).
The issue is that the $PATH variable passed to the Qt Creator IDE is absolutely vanilla: /usr/bin:/bin:/usr/sbin:/sbin.
So I have to write bash -c '/path/to/ninja list of targets' instead of just…

Nickolay Merkin
- 2,673
- 1
- 16
- 14
5
votes
3 answers
Retry command line in bash script until successful then continue with script
Hopefully someone must know this one and I can answer my other question. Launchagent attempts to load my script too quickly and thus it fails - I've set its nice to 20 and everything else to the end but still, when creating accounts its too…

realdannys
- 1,383
- 1
- 12
- 18
5
votes
2 answers
Launchd not loading nginx on startup
I installed NGINX with homebrew then I got info and followed the instructions to load the launchd plist
$ brew info nginx
nginx: stable 1.6.2, devel 1.7.7, HEAD
...
To load nginx:
launchctl load…

jwerre
- 9,179
- 9
- 60
- 69