A system for starting, stopping, and managing automated processes.

learn more… | top users | synonyms

30
votes
4answers
29k views

Why am I getting a “dubious ownership of file” error when Launch Agent runs my .plist file?

I have a Launch Agent configured to run a .plist file for example: /Library/LaunchAgent/foo.plist. Inside this .plist, it is set to run during LoginWindow and Aqua. When I attempt to launch my ...
17
votes
6answers
11k views

runaway distnoted process

Sometimes I see a distnoted process suddenly spin up and chew up 100% CPU (on one core) and a ton of memory, often in the neighborhood of 1.5G or so. This happens a few times a day, starting a month ...
15
votes
4answers
2k views

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 ...
13
votes
3answers
2k views

Why is cron being deprecated?

I just found out that cron has been deprecated in Mac OS X. Why is this, and will it eventually be completely removed from future releases?
10
votes
1answer
2k views

Using tmux and pbpaste, pbcopy, and launchctl

I have discovered that tmux breaks pbpaste, pbcopy and launchctl. Is there a good way to make it play nice with these tools?
8
votes
2answers
2k views

Automatically delete a folder daily

Is there a way to automatically have a folder deleted every day at 4am? I'm running 10.6.7.
8
votes
3answers
4k views

ssh-under-cron stops working in OS X 10.7 Lion

Just upgraded from Snow Leopard to Lion, and my cron jobs that use ssh have stopped working. It appears that ssh-agent is no longer functioning as expected. Here's a bowdlerized version of my ...
8
votes
2answers
6k views

Too Many Open Files

Which command / configuration file controls the open file limits on OS X? Is there a different command for OS X 10.5 / 10.6 / 10.7? The options I explore below are ulimit, sysctl, and launchctl ...
8
votes
3answers
695 views

How do I automatically kill processes that leak memory?

I have problems with processes that leak memory. They cause my hard drive to be filled with swap files in /private/var/vm. I would like leaking processes to be killed at sight by the OS. I’m not ...
7
votes
4answers
10k views

What's wrong with my launchctl config?

I'm trying to auto-run SickBeard on login python /Applications/Sick-Beard/Sickbeard.py <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN ...
6
votes
1answer
6k views

Stopping LaunchAgents and Daemons

I work as admin in a college environment. One of the challenges is to stop the services installed by students with CS major. Some time back they got the admin access and installed launch agents and ...
5
votes
2answers
1k views

Run a shell script when switching to battery power

User Story: As a MacBookPro user I want to run a script that ejects my USB drive when I disconnect the power source so that I don't have to remember to eject it before grabbing my laptop and hurrying ...
5
votes
1answer
1k views

How can I run a job once a day with launchd, regardless of when the computer is on?

I would like to run a shell script daily, but not necessarily at a specific time. The computer the script runs on is switched on at irregular times, and no assumptions can be made when that will be. ...
5
votes
2answers
926 views

How to mount a RAM disk on startup?

I'm trying to mount a RAM disk on startup with this: /Users/Aram/Development/Tools/ramdisk.sh diskutil erasevolume HFS+ "RamDisk" `hdiutil attach -nomount ram://800000` com.aram.ramdisk.plist ...
5
votes
1answer
453 views

/etc/launchd.conf setenv value containing whitespace

In my /etc/launchd.conf file, I added these lines in an effort to figure out exactly how to create globally scoped environment variables whose values contain whitespace. setenv foo1 123456 setenv ...
4
votes
2answers
2k views

How can I stop com.apple.launched from attempting to start a service we uninstalled?

My office used to use JungleDisk Workgroup service to exchange large files. We've moved on to a new solution and I uninstalled the client according to their instructions, but I noticed today in the ...
4
votes
3answers
1k views

Automatically relaunch a closed application

I have an application that opens when I login. Is there a way to relaunch it automatically if it crashes or if I close it inadvertently? (the application in question is Transmission if there is any ...
4
votes
5answers
2k views

Run bash script at login stored in the home folder?

When I try to load a LaunchAgent plist from launchctl I can't find out how to run a script in the home directory. My code is: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC ...
4
votes
3answers
3k views

Mac won't boot: Way to mount drive and delete one file?

My macbook is currently a brick. I added a /etc/launchctl.conf file that must be malformed. The OS now crashes even when attempting to start in safe mode: "launchd System bootstrapper has crashed: ...
4
votes
3answers
1k views

Can launchd run programs more frequently than every 10 seconds?

I have some services like this that I'd like to run almost immediately after files are modified. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST ...
4
votes
2answers
354 views

Run a launchd job after Time Machine backup

Quite simply, I have a process that's triggered by launchd but currently runs once an hour, however really what I would like it to do is run once a Time Machine backup has completed. Initially I ...
4
votes
2answers
3k views

How to properly increase ulimit -n on Lion?

I'm trying to download the X-Plane 10 Demo through uTorrent, however I get a "too many open files" error all the time. I can do the alternate download (which takes forever and a day), but I wonder how ...
4
votes
3answers
292 views

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 ...
4
votes
1answer
285 views

What is the difference between cron and lauchd?

What is the difference between cron and lauchd? I have always used cron, but I have recently heard that launchd is better. Why? In what ways is cron better? In what ways is launchd better?
4
votes
1answer
1k views

Stopping a macports installed mysql daemon

I'm trying to reset my root password on a macports installed MySQL on OS X. But none of the ways to do this that I can find works, for various reasons. One reason common to all is that I can't stop ...
4
votes
3answers
732 views

Can't quit app launched through launchd

As it says in the title, "Can't quit app launched through launchd"—or more precisely, I can quit it, but it then automatically restarts again. Background: I prefer to use BusyCal, not iCal, but ...
4
votes
2answers
953 views

How to automate DropBox startup without logging in

I'd like to have DropBox running under multiple user accounts on a Mac, even after a reboot. The Mac auto logs in as one user, not me. How to best achieve this?
4
votes
1answer
6k views

Should I be concerned if the helpd process is eating RAM after an upgrade to Lion?

Hallo, I've recently upgraded to Mac OS Lion from Snow Leopard on my 2009 Unibody Macbook. Now, checking in activity monitor I often find a strange process named helpd taking large parts of the memory ...
3
votes
1answer
6k views

Running a command whenever Mac boots up with launchctl/plist

I need to run nohup nice synergys -f --config ~/bin/conf/synergy.conf & command whenever the computer boots up. As is written in this post, I came up with the following plist code. <?xml ...
3
votes
3answers
2k views

Finding the true status of launchd jobs

launchctl list launchctl bstree These show which jobs are active, dormant or inactive, allegedly. I have never seen an inactive job personally. Even ones that I have tried to inactivate show as ...
3
votes
2answers
661 views

What is the difference among the various event schedulers for OS X / Darwin?

I'm confused about the differences among the three (that I know of) tools for scheduling running of code on OS X / Darwin: cron launchcd pmset I understand that cron is largely deprecated, but it ...
3
votes
2answers
552 views

LaunchDaemon not recognised

I've installed CouchDB via MacPorts. Now I want to start it when my Mac boots, so I executed the instructions given in the install process: sudo launchctl load -w ...
3
votes
2answers
458 views

Find process associated with launchd

TCP port 5901 is open on my machine and is causing some mischief, and I want to know which process is opening it. When I run lsof -i -P I see that launchd is the process that opened the port. Is ...
3
votes
2answers
127 views

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 ...
3
votes
2answers
365 views

Make locator.updatedb run daily on Snow Leopard w/o hacking /System/Library?

On Snow Leopard, the locate database is updated once a week by a launchd job, /System/Library/LaunchDaemons/com.apple.locate.plist. I'd like to make the updater run daily, but AFAIK it's considered ...
3
votes
1answer
5k views

What does lsboxd process do on os x?

My firewall asked me for a connection from lsboxd (module com.apple.ls.boxd, ) to one another computer in my network to the port tcp 548. What does it do? I found that it is a part of sandbox ...
3
votes
2answers
54 views

Add Static ARP Entry at Boot

I'm new to Mac OS X. On Linux I'd: append to /etc/rc.local arp -i eth0 -s 192.168.1.1 00:00:00:00:00:00 I've figured out how to do it in Terminal: sudo arp -s 192.168.1.1 00:00:00:00:00:00 But ...
3
votes
1answer
105 views

What is the relationship between `launchctl limit` and `ulimit`?

There is not any ulimit configuration in system startup files/ shell startup scripts. ulimit -a shows: -u: processes 1064 -n: file descriptors 256 launchctl ...
3
votes
1answer
223 views

Opening an OS X disk image with a launchd agent while the display is sleeping

I created a launchd agent which opens a non-password-protected sparse disk image (and mounts its solitary volume) daily at 2:45AM in preparation for backup software to write to the volume. The launchd ...
2
votes
2answers
1k views

How to run a nightly backup job on Snow Leopard Server via launchd

I have been trying to configure a nightly backup job on my Mac Mini server, and after a lot of Googling and digging and man-page'ing, I figured out that launchd seemed to be the correct too, and tried ...
2
votes
2answers
893 views

Run plist command every 5 seconds

I have the following plist file in my User/Library/LaunchAgents folder. It presses the "g" key every 60 seconds. My question is, how can I change this to press the "g" key every 5 seconds? ...
2
votes
2answers
1k views

Is there a way to load a LaunchAgent as another user?

From a script run as root I copy a LaunchAgent .plist to /Users/xyz/Library/LaunchAgents. If I load that via launchctl logged in as user xyz it works without problems. If I try to load it from the ...
2
votes
1answer
970 views

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 ...
2
votes
3answers
470 views

no such process error with launchctl start. Mac OSX 10.9

The goal is to set machine's network name with the ipaddress of this machine. I have created a plist file and put it into /Library/Launchagents/. For debugging reason I used the command "launctl ...
2
votes
1answer
86 views

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 system.log. I'm running OS 10.9. I ...
2
votes
1answer
2k views

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)?
2
votes
2answers
51 views

Is there a way to make launchd stop a service on sleep and start it up again on wake?

I have several pieces of server software installed on my MacBook Pro for work using Homebrew. There is one service in particular, that likes to peg the CPU after the OS wakes up from sleep until I ...
2
votes
2answers
1k views

How to find out what launch agent or daemon is starting a process

After installing Autodesk Smoke, I have two httpd processes running all the time, and I'd like to stop them. When I use sudo killall httpd, they stop and are restarted right away. Activity Monitor ...
2
votes
1answer
419 views

Why is my 'launchd' task not responding to changes in watched files?

I have a launchd task that is not triggering when a file changes, and can't figure out why it's failing. When I load the .plist below with launchctl load ...
2
votes
1answer
188 views

How can root launch a regular Mac application from a cron job in /etc/crontab?

I want the cronjob to do some things as the superuser, and depending on the result, launch an app as me, the logged-in user. I've tried a bunch of things but nothing I think should work does. ...