Questions tagged [launchdagent]
23 questions
12
votes
4 answers
Starting/stopping a launchd agent for all users with GUI sessions
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…

Redwood
- 66,744
- 41
- 126
- 187
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
4
votes
0 answers
Keyboard and Mouse Simulation failed in macOS Pre-login Window
I am a newbie to launch agent and daemons.I have created a pre-login agent and it will launch my application when login window open.I can simulate the keyboard and mouse events with CGEventPost in the user session. Please refer the code
//For…

boopathy
- 427
- 2
- 9
- 20
4
votes
1 answer
Are there any conditions when launchctl fails to run or load a plist?
Sometimes I see that firing the command doesn't load the app at all. This happens rarely but are there any known conditions or situations where this command would fail? Is there any way to debug launchctl?
launchctl load…

ZestyZest
- 911
- 13
- 27
4
votes
1 answer
OS X - Communication between launch daemon and launch agent
I am new to OS X and have to create an application having 2 parts - launch daemon and launch agent. The daemon is going to do stuff such as command execution, logging, etc and has to somehow communicate these results to launch agent (which would…

Sagar Natekar
- 231
- 3
- 11
3
votes
0 answers
Global LaunchAgent implementation on macOS
I have been trying to implemented a working global launch agent which can work across multiple users, but I cannot get it to the finish line. It is working for a single user perfectly but when switched to a different user the launch agent is failing…

u77382639
- 31
- 3
3
votes
1 answer
launchd ExitTimeOut doesn't work
I Have a plist file with some job:
Label
StartScript
Program
/Users/ie54553/Desktop/script.sh
StartInterval
10
…

Igal
- 4,603
- 14
- 41
- 66
3
votes
1 answer
launchd Job failed to exec(3) for weird reason: 8
I'm trying to schedule a simple task in OS X Mountain Lion 10.8.3
launchctl start nextstopsun.helloworld
command doesn't execute the script and throws a message to a console
4/2/13 9:50:49.663 PM com.apple.launchd.peruser.501[139]:…

nextstopsun
- 443
- 7
- 14
1
vote
1 answer
should we use .app bundle or the unix exe of the GUI app for launching as an Agent
I wanted to launch a GUI Application as a User Agent in Macos, but I m not sure about the right way of doing it. I m aware of 2 ways and wanted to know which should be used and why?
Using the Unix exe present in the .app application bundle for my…

Vipul Gupta
- 239
- 5
1
vote
0 answers
macOS 11 Launch Agent can't access NFS shares
I am trying to set up a launch agent on macOS 11 to run a script on an NFS share. My launch agent works when the script is located on the local computer but fails with Operation not permitted when the script is located on NFS. Is it possible to give…

RegedUser00x
- 2,313
- 5
- 27
- 34
1
vote
1 answer
Error code 9216 when attempting to access keychain password in LaunchAgent
There are several other questions that discuss accessing the keychain from LaunchAgents.
One of the key ones is here where joensson mentions that you need to set a in your app plist.
I have done that, and now my application plist…

turtlemonvh
- 9,149
- 6
- 47
- 53
1
vote
1 answer
Run plist on wake
I've been searching all over and found options at launchd site. Is there a way to launch a .plist on machine wake? If this is not possible is there a way to run a shell script without installing another package and just use plain shell?

JohnnyQ
- 4,839
- 6
- 47
- 65
1
vote
0 answers
OSX: Why is my launchd agent running my script twice?
I have one plist associated with this launchd agent. There is one agent listed in launchctl list, and it calls my bash script, called rc.wakeup, whenever the mac is woken up from sleep. There is only one copy of this bash script. The code in the…

Kyle Birch
- 75
- 1
- 10
1
vote
1 answer
launchd start automatically
Trying to create a task that starts on every day at 4AM to restart my mac and execute some maintenance scripts. This is my script:

bladepit
- 853
- 5
- 14
- 29
1
vote
1 answer
How to install launch agent on Mac os x 10.5 / 10.6
I have developed a launchAgent in cocoa. It works fine for me on dev environment, by placing the plist file in location /Library/LaunchAgents/.To distribute and install this on other laptops, I created the package using package maker tool. As part…

Unicorn
- 2,382
- 6
- 29
- 42