Questions tagged [launchd]

launchd is a Mac OS X daemon that manages launching programs and network services on behalf of the system or individual users. It attempts to replace most of the functionality of traditional UNIX init, cron, inetd, and other system services.

launchd is a Mac OS X daemon that manages launching programs and network services on behalf of the system or individual users. It attempts to replace most of the functionality of traditional UNIX init, cron, inetd, and other system services.

Some additional resources:

49 questions
188
votes
9 answers

How to start/stop/restart launchd services from the command line?

How do I restart, say for example my httpd or afpd, running any Mac OS X >= 10.5 (Leopard-), without having to use the GUI and go to System Preferences -> Sharing and unchecking/checking "Web Sharing"? I'm looking for the canonical equivalent to…
conny
  • 2,259
  • 2
  • 16
  • 14
50
votes
3 answers

How do I activate launchd logging on OS X?

How do I activate launchd logging on OS X 10.6? I added a new daemon that is not starting properly (status is 1). I want to debug the problem but I was not able to find launchd logs, they are not in /var/log/launchd.log.
sorin
  • 7,668
  • 24
  • 75
  • 100
32
votes
4 answers

Use an environment variable in a launchd script

I'm curious if it's possible to specify an envrionment variable in the ProgramArguments portion of a luanchd script on Mac OS X Leopard.
matpie
  • 453
  • 1
  • 5
  • 9
20
votes
1 answer

What do the numbers in launchctl list's status column mean?

launchctl has a "Status" column in the launchctl list output. The manpage or any of the related launchd manpages do not mention this column or what it means.
ldrg
  • 381
  • 1
  • 4
  • 8
13
votes
3 answers

How do I launch a process as a specific user at startup on OS X?

I would like to run a script as a particular user on startup (not on login). I thought a launchd LaunchDaemon would do it, but 'man launchd' says: "If you wish your service to run as a certain user, in that user's environment, making it a launchd…
Scott Bonds
  • 131
  • 1
  • 3
10
votes
2 answers

Manually start scheduled launchd job

On our Mac OS X (10.6) Server we have setup several backup scripts that are controlled by launchd and launched at specific times. For this we have defined StartCalendarInterval and this all works very well. Now it happens that I would like to start…
Pascal
  • 238
  • 2
  • 8
9
votes
3 answers

How does one check whether the OS X "disabled" flag for launchd services is set?

According to the man page for launchctl (emphasis mine):    -w   Overrides the Disabled key and sets it to false. In previous versions, this option would modify the configuration file. Now the state of the Disabled key is stored elsewhere…
Charles Duffy
  • 946
  • 2
  • 10
  • 19
7
votes
2 answers

How do I limit launchd log size on OS X?

As this answer suggested, I activated logging of a .plist file I have generated. StandardOutPath /path/to/logfile.log StandardErrorPath /path/to/another_logfile.log However, the log files are…
Rekovni
  • 211
  • 1
  • 8
6
votes
1 answer

Clarification on launchd plist Program and ProgramArguments usage

Can somebody please clarify how launchd's Program and ProgramArguments configuration parameters should be used? I tried to register a service which on the command line I'd start like this: $ /foo/bar/baz/python /foo/bar/baz/service start I have…
deceze
  • 473
  • 1
  • 6
  • 20
5
votes
3 answers

What is preventing me from piping from a '600' file into mail within launchd?

In OSX 10.6 I'm running logcheck.sh via. launchd using this plist
bias
  • 225
  • 3
  • 13
4
votes
1 answer

Run Cron daemon on OS X 10.10

I am maintaining some OS X 10.10 machines which require cron for various tasks (watchdog processes, /tmp cleaners, etc.). One of them has mysteriously stopped its cron daemon, and I can't seem to bring it back up short of manually running the…
Score_Under
  • 273
  • 3
  • 7
4
votes
1 answer

How do I setup an network (port 8080) launched on-demand service with launchd

I'm trying to run a service in 'ondemand' mode, but I can't even get launchctl to register the service. $ launchctl load /Library/LaunchDaemons/org.fossil-scm.fossil.plist bind(): Permission denied bind(): Permission denied $ As I'm getting a…
Stephen
  • 173
  • 1
  • 3
  • 8
3
votes
0 answers

MAC OS X Server, process keep respawning after unloaded from launchd

I am constantly getting the following messages in system log: com.apple.launchd.peruser.0 (homebrew.mxcl.memcached[PID]) Exited with code : 64 com.apple.launchd.peruser.0 (homebrew.mxcl.memcached) Throttling respawn: Will start in 10…
Ranster
  • 31
  • 4
3
votes
1 answer

Launchd script's output not being logged to system.log

Sample script: #!/bin/bash echo "Hello?" ... (other things) When run via launchd, it definitely runs (the other things are being done) but nothing shows up in /var/log/system.log. I'm running OS 10.9 Mavericks. I tried replacing that line…
jstm88
  • 747
  • 2
  • 9
  • 21
3
votes
6 answers

Removing a process from launchd without restarting

I have a machine on which I do not want finder to run, so initially I made it unexecutable: sudo chmod -R a-x /System/Library/CoreServices/Finder.app But then realised that launchd was still trying to launch finder multiple times every second,…
DanielGibbs
  • 573
  • 5
  • 12
  • 31
1
2 3 4