A system for starting, stopping, and managing automated processes.
Questions tagged [launchd]
779 questions
59
votes
2 answers
Launchctl difference between load and start, unload and stop
I was reading through the launchctl man page and have a few questions about its functioning:
What is the difference between load and start, unload and stop?
Where do I find the job label for a daemon, is it in the plist file?

Jason Rubenstein
- 591
20
votes
4 answers
Can anyone recommend a good tutorial for writing (from scratch) a cron-style launchd job?
I've got a fairly simple job that I'd like to run every hour. I could do it using cron, but I thought I'd use this to learn about launchd, since I hear good things about it. I've got the man launchd.plist page as a reference, but I'm looking for…

Hank Gay
- 542
15
votes
1 answer
What is the default working directory of a script run via launchd?
I'd expected this to be easy to find on Google, but wasn't able to discover anything.
I know that the working directory of a launchd agent/demon can be changed via the workingdirectory key. However, this key is optional. If no working directory is…

Wowfunhappy
- 7,383
10
votes
5 answers
How to stop OS X from trying to run TeamViewer every 10 seconds
I recently happened to look at my system.log file and noticed the following messages over and over:
Mar 4 12:09:32 ix com.apple.xpc.launchd[1]
(com.teamviewer.teamviewer[11506]): Service could not initialize:
Unable to set current working…

Michael
- 1,333
- 9
- 21
- 41
10
votes
3 answers
How can I find what process is starting apps in the background?
I keep seeing CIJScannerRegister running. I'd like it to never run. Every time it appears I use launchctl to remove its listing and that kills the app. But it reappears later. I know where CIJScannerRegister lives and could delete it, but I would…

Jack Frost
- 101
8
votes
1 answer
Why is an application running so slowly when started with launchctl?
I've written an application in C++, using OpenGL and Cinder. When I launch the app file from the Finder, it runs nice and smoothly at 60FPS. However, when I launch it using launchctl load the performance is terrible, the UI is sluggish and in…

JeremyFromEarth
- 181
- 4
6
votes
2 answers
How can I write to Notification Center from a launchd command?
I've got a plist set to run at a set interval, and have put it in /Library/LaunchDaemons like so:
/Library/LaunchDaemons $ ll macports_update_notifier.plist
lrwxr-xr-x 1 root wheel 55B 5 Sep 13:47 macports_update_notifier.plist@ ->…

ivvi
- 353
6
votes
2 answers
What does launchctl unload actually do?
When running launchctl unload some.plist, what is this command translated to specifically, in terms of UNIX commands, etc.
There is nothing in .plist files that specifies any "command line to run when the user specifies unload", so does macOS simply…

forthrin
- 2,631
6
votes
4 answers
Postfix auto start on Sierra for smtp relay
Postfix works great when I start it manually. Can relay off of it from other hosts on my network; telnet to it on port 25 etc.
How do I get it to auto start such that It will always be listening on port 25?
I understand it starts up every minute or…

Ramias
- 83
5
votes
0 answers
launchctl issues: Bootstrap failed: 5: Input/output error
Before Big Sur I was able to use launchtl like this:
plst file:
Label
com.iPinky7.removeLogs
Program
/Users/michael/Downloads/Python/scripts/removeLogs.sh
ProgramArguments
commandLineArgument
…

iPinky7
- 51
5
votes
1 answer
com.apple.pc.launchd keeps respawning every 10 seconds -- problem with MRT, MRTd?
I am running OS X El Capitan, on an iMac (27-inch, Mid 2010). Using "top," I noticed that my systems was always running "ReportCrash"; I looked into the logs, and found:
1/25/18 12:32:51.464 PM com.apple.xpc.launchd[1]: (com.apple.MRTd) Service…

user273763
- 51
5
votes
2 answers
Why is launchd saying "service already loaded" but "launchctl list" doesn't show the service?
I created the configuration files in ~/Library/LaunchAgents
When I attempted to load the plist, I got the message that the service was already loaded.
launchctl load ~/LaunchAgents/hosts_Blocksites_AM.plist …

BryanWheelock
- 175
4
votes
2 answers
launchd: ask user before performing tasks
Is there a way to get a user-defined launchd task (i.e. like the one in this question) to get user confirmation before executing the task? A popup like the one for scheduled sleep (with yes/no and a timer in case of no user input) would be great,…

newenglander
- 1,527
4
votes
2 answers
Force launchd to re-read environment variables
Is there any way, short of rebooting, to force launchd to re-read environment variables newly defined in /etc/launchd.conf?
Can it be done with launchctl(1)?

Ralph
- 1,735
4
votes
1 answer
macOS methods for applications autostarting
It is known to me that application autostart is based on different methods:
Login elements in the System…

mp1
- 71