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

learn more… | top users | synonyms (2)

42
votes
8answers
31k 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 ...
39
votes
4answers
36k 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 ...
15
votes
4answers
3k 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?
12
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?
10
votes
4answers
13k 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 ...
9
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
3k 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
2answers
7k 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
845 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
1answer
8k 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 ...
7
votes
2answers
408 views

Is loading your desktop before login safe?

I came across an article explaining how to load your desktop before you login. Does anyone know if this works in Lion? Is there any reason I should avoid attempting it? Load your desktop before ...
6
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
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 ...
5
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 ...
5
votes
2answers
1k 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 ...
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
3answers
76 views
+50

Run Script on Logout Without Use of Logout Hook

I've been looking into running a few cleanup commands when a user logs out, however the old logout hook feature, although still functioning, has been deprecated for some time now so may not be with us ...
5
votes
1answer
155 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 ...
5
votes
2answers
1k 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
641 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
2k 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
3answers
4k 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
1answer
7k 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 ...
4
votes
2answers
494 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
386 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 ...
4
votes
3answers
897 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
2answers
4k 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
1answer
295 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
1answer
8k 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 ...
4
votes
3answers
804 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
1k 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 ...
4
votes
0answers
35 views

Launchd starts event 40 seconds later?

I've created a .plist file, which should act as system daemon (global with root user). This .plist file listens to the settings directory for changes like changing network settings. When this happens ...
3
votes
3answers
3k 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
1answer
384 views

how to block Adobe, Google and others from installing crap on my Mavericks

Adobe and Google insist on install crap on several folders, like update checkers and things like that. This is the crap I have identified by Adobe. ...
3
votes
2answers
577 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
518 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
134 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
1answer
136 views

launchd with high disk usage

launchd is producing a lot of I/O activity. In the last day and a half it managed to write 12 GB of data while reading 500MB. I the logs I do not see anything suspicious. Any suggestion at where ...
3
votes
1answer
368 views

In Mountain Lion why do remote shells via ssh do NOT inherit the environment of the launchd parent process?

When logging in to my Mountain Lion Mac remotely via ssh I do not get the same PATH variable as when I open a shell locally: The local shell inherits its environment as expected from launchd and ...
3
votes
2answers
3k 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)?
3
votes
2answers
93 views

Run action when device is detached

I'm using a launchd agent to run a shell script whenever I connect my thunderbolt dock. I've been able to use IOKit notifications to detect when the dock is being attached, but I also want to run a ...
3
votes
1answer
315 views

How to run multiple commands on reboot using launchctl/plist?

In OS X, you can write a plist file in ~/Library/LaunchAgents/ (or something similar, depending on what permissions/users you like it to be operated on), and load it using launchctl to make it ...
3
votes
1answer
251 views

Uninstalling Genieo broke my system

Update below, the rest is more or less background information. After discovering a Genieo install, I vaguely recalled it being, well, not trustworthy. After a quick search I knew I wanted to ...
3
votes
2answers
279 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
4answers
2k 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 ...
3
votes
2answers
4k 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 ...