Launchd is a process management daemon, similar to "init". It is commonly used on Darwin-based systems.
Questions tagged [launchd]
640 questions
9
votes
5 answers
OSX service started via launchd plist can't find executable
I am trying to write a launchd.plist file for my node server. I am using forever to run my node server. I would like the server to start on boot. I would also like to wait for the mongodb launchd plist to run first.
I installed mongobb using…

lostintranslation
- 23,756
- 50
- 159
- 262
9
votes
2 answers
iPhone SDK strange console message launchd_core_logic.c
I am running release version of the app on the iPhone, it works fine. There is no error messages in the XCode debugger:
Running…
Switching to thread 11779
Switching to thread 11779
sharedlibrary apply-load-rules all
(gdb) continue
Switching to…

leon
- 1,412
- 2
- 17
- 26
8
votes
1 answer
Mac Launch Daemon unable to retrieve password from system keychain after saving it there
We have a Launch Daemon which (necessarily, for various reasons) runs as root, and which communicates with a server component via the network. It needs to authenticate with the service, so when it first obtains the password, we save it to the system…

pmdj
- 22,018
- 3
- 52
- 103
8
votes
1 answer
How does OSX Activity Monitor match XPC tasks to their initiator process?
When an application process launches an XPC helper process, it doesn't actually do the fork()/exec() itself in the classic UNIX style. Instead, it sends a message to launchd, which does the dirty work for it. Thus, if you query the parent process on…

pmdj
- 22,018
- 3
- 52
- 103
8
votes
7 answers
MacPorts Apache2 Stopped Launching on Boot
Something that I've noticed recently on two different machines is that Apache2 installed via MacPorts seems to have stopped launching when I boot up. The honest truth is that I can't swear it did so before, but it's something I think I'd notice…

Rob Wilkerson
- 40,476
- 42
- 137
- 192
8
votes
2 answers
Using a LaunchAgent inside the Mac app sandbox
How would you use a LaunchAgent inside the sandbox? I want to distribute a UI-less LaunchAgent app bundle inside my main application that I can launch on demand. The reason I want this instead of an XPC service is for the KeepAlive option, which…

indragie
- 18,002
- 16
- 95
- 164
8
votes
4 answers
launchd.plist runs every 10 seconds instead of just once
I have been setting up a launchd.plist XML that is run every time a specific USB device is mounted. I followed the instructions on the xpc_events(3) man page and it is running the application whenever the device is mounted.
The problem I'm having is…

Christoffer
- 25,035
- 18
- 53
- 77
8
votes
3 answers
running sudo command in bash script and running it with launchd
I have a bash script that I would like to run with a launchd plist file on OS X. The problem I have is is that the bash script contains sudo commands and it is stopping it from running. So for example my bash script looks like this:
#!/bin/bash
sudo…

jpayne
- 102
- 2
- 9
8
votes
2 answers
How to access environment variables in launchd plist
I have a launchd per-user agent. In it's .plist, I would like to use the $HOME environment variable.
Is it possible?
(it is the "Program" key, which I would like to define as "$HOME/bin/myscript")

mivk
- 13,452
- 5
- 76
- 69
7
votes
1 answer
Execute process as current Mac OS X user, not as root
I have created a Mac OS X helper application that always runs under root. I need to launch other application from it, but not as root. I want it to be launched from the current logged in user (not sudoed root).
I've tried to use [NSTask…

Daniel O'Hara
- 13,307
- 3
- 46
- 68
7
votes
0 answers
Is there a MacOS (launchd) implementation for IHostLifetime?
Microsoft has defined the IHostLifetime interface for WorkerServices to run as services on different platforms. (You can create a Worker Service project with dotnet new worker in the console).
If you want to run them as system services, you can use…

Mafii
- 7,227
- 1
- 35
- 55
7
votes
2 answers
Anyone submitted or know of an application in the Mac App Store that uses launchd?
Just wondering if anyone has sucessfully submitted an app or know of an app that exists in the Mac App Store that uses launchd.
Thanks.

David
- 14,205
- 20
- 97
- 144
7
votes
2 answers
How can I create a launchd agent that will run only once?
Since there is no "Year" parameter in the launchd plist format, how is it possible to create an agent that will run only once and not once a year?

brandelune
- 116
- 1
- 7
7
votes
3 answers
~/Library/LaunchAgents plist runs manually but not automatically
I am starting to work with launchd and want to set up a plist file such that whenever I insert an SD card into my Mac mini server (with Snow Leopard Server), I want a shell script to run (which should copy all the jpg files, rename them etc).
So, I…

user548071
- 71
- 1
- 1
- 2
7
votes
1 answer
Packaging C binary in Mac OS X Application Bundle
I'm trying to package my binary in a minimalistic app bundle. But I'm seeing some strange behavior with the result.
My bundle has this minimal structure:
$ ls -R HelloWorld.app
Contents
HelloWorld.app/Contents:
Info.plist MacOS …

Johan Bilien
- 412
- 2
- 12