Questions tagged [launchd]

launchd is an open-source daemon intended to streamline and accelerate starting and stopping of processes on a *nix OS.

launchd is an open-source daemon intended to streamline and accelerate starting and stopping of processes on a *nix OS. It is intended to totally replace the following daemons or systems of scripts:

  • inetd/xinetd
  • init and init.d
  • rc and rc.d
  • atd
  • crond
  • watchdogd
  • SystemStarter

The wikipedia page is also a good basic launchd reference.

183 questions
80
votes
11 answers

How can I get a script to run every day on Mac OS X?

Cron? Launchd? iCal?? If so, how?
51
votes
8 answers

how to kill process in Mac OS X and not have it restart on its own

When I run sudo kill -9 [PID] with the proper process ID, the process stops but then is restarted and has a new PID. I'm trying to kill the mysqld process. How can I mimic the Activity Monitor in killing a process? In the Activity Monitor, when you…
Hristo
  • 1,269
36
votes
5 answers

How do I run a launchd command as root

I have the following launchctl command as a .plist file. It's loaded and set to run once a day but, it needs to run as root and I'm not sure how to verify this. Also, this cron job basically CDs into a directory and runs a command. I'm sure…
29
votes
8 answers

Can’t launch daemon with launchctl in Yosemite

I have a launchd daemon placed in ~/Library/LaunchAgents that worked well in Mavericks. But it won’t start in Yosemite public beta. The daemon plist is like this (my username is darksair with UID 501)
MetroWind
  • 581
  • 1
  • 8
  • 15
28
votes
5 answers

Setting environment variables in OS X for GUI applications

How does one set up environment variables in Mac OS X such that they are available for GUI applications without using ~/.MacOSX/environment.plist or Login Hooks (since these are deprecated)?
18
votes
2 answers

Running app on MacOSX Mountain Lion: Job failed to exec(3) for weird reason: 13

I tried to run an app on my mac but it quickly closes, I've checked the Quarantine flag but that was not the problem, I checked Console and here's the error information: 9/24/12 1:44:19.343 AM com.apple.launchd.peruser.501[150]:…
Shahin
  • 491
15
votes
2 answers

How to restart launchd OS X without rebooting?

When I run Zotero/Firefox, they often crash and I am left with zombie processes; after this I cannot open new instances of Zotero or Firefox. I want to get rid of these zombie processes rather than rebooting, so for of the zombie process, $ ps…
hatmatrix
  • 924
15
votes
1 answer

How to get a launchd plist to diretly run a complex 1 line bash command?

I have a somewhat complex bash command which includes some pipes and an if-then-else clause, not to mention calling system program (such as grep) with multiple parameters. Is there a way to create a plist that launchd will load and run this complex…
UrEl
  • 891
15
votes
6 answers

How to register an agent with launchd

I’m unable to schedule a periodic launch with launchctl/launchd on OS X (Leopard). Basically, I’m unable to find a step-by-step list of instructions on the web and the intuitive approach doesn’t work. The sync.plist file:
13
votes
1 answer

com.apple.launchd: com.apple.launchd.peruser error

It's been a couple of days I am reading these errors in the system log file. 25/11/11 21:31:43,373 com.apple.launchd: (com.apple.launchd.peruser.32697[92747]) getpwuid("32697") failed 25/11/11 21:31:43,374 com.apple.launchd:…
nick2k3
  • 255
12
votes
2 answers

How to start a service using Mac OSX's launchctl

Why does my configuration plist file not load as a service using launchctl? I am running OSX Yosemite, and I have read this excellent tutorial on using launchctl http://nathangrigg.net/2012/07/schedule-jobs-using-launchd/ I have created a correct…
almel
  • 241
12
votes
3 answers

removing startup item from com.apple.launchd

I installed a program a few months ago, it had a startup option that I did install. Later, I decided to remove the program, but it seems to have left the startup script or item even after I uninstalled it.... and its trying to start every few…
Peter
  • 263
12
votes
2 answers

Common Mac OS folders/settings to check (when trying to get rid of a pesky self-launching app)

If there's an app that starts up by itself, what would the most efficient places to look for it be? Does anyone have a nice comprehensive list of where to check for Startup Items, Login Items, Login Hooks, Cron, kernel extensions, etc... At this…
username
  • 1,428
10
votes
2 answers

Is launchd supposed to pick up "missed" events?

I read that if the computer is sleeping when a launchd event is to occur, then launchd will run the event when the computer wakes up. My question is in regards to a computer that is shut down. If the machine is powered off when a launchd event is…
Sam Axe
  • 490
9
votes
1 answer

launchd seems ignore StartCalendarInterval on Yosemite

I tried to update Homebrew on time with launchd. My plist file is presented here:
1
2 3
12 13