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

learn more… | top users | synonyms (2)

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 ...
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 ...
3
votes
1answer
334 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 ...
1
vote
1answer
1k views

prevent launchctl from starting a anonymous process

I have installed dnsmasq and now I want to be able to start it with launchctl. The problem is that every time I start the app launchctl starts an anonyous process instead of using the specified label. ...
1
vote
1answer
2k views

Setting a static route every boot with launchd / plist is failing

I hope to use launchd to set a static route on a server at boot time since I haven't figured a better way to configure this sort of networking on a server. My problem is that the command seems to be ...
28
votes
8answers
18k 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 ...
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
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.
1
vote
2answers
844 views

Automatically backup JailBreak iPhone DCIM photo directory

Hi I heard that you can write cron job into plist and put it to JB iPhone /Library/LaunchDaemons folder in plist format I would like to backup the photo folder every 300 seconds, so I put a ...
4
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 ...
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 ...
1
vote
1answer
2k views

Disable Screen sharing via the command line in mountain lion

I want to be able to enable and disable screen sharing from the command line rather than through System Preferences. This is on 10.8.3 To enable screen sharing, I find I only need to change a ...
1
vote
1answer
780 views

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 ...
1
vote
1answer
735 views

How to automate execution locate.updatedb by using a bash script

I am looking for a bash set of commands that will enable me to schedule the execution of /usr/libexec/locate.updatedb once every day. Please respond only with a set of command line commands, because ...
4
votes
2answers
980 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 ...
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 ...
1
vote
1answer
321 views

double password entry to access account

I have the Require password 4 hours after sleep ... option in Security and Privacy System Preferences set and am running a script with launchd to suspend my session at a certain time of day (see this ...
1
vote
1answer
2k views

Automatically Load LaunchDaemon?

I wrote a little script to automatically update my Network Location based on a couple of conditions, and have coupled that with a launchd plist to have it run every couple of minutes. However, I've ...
0
votes
1answer
124 views

Making items added to paths via paths.d show up everywhere under Mavericks

I'd like to set the path under OS X Mavericks so that the setting shows up everywhere (e.g., in .apps and in Darwin shells). There's plenty of discussion out there about how to set environment ...
3
votes
1answer
177 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
131 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 ...
2
votes
2answers
936 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? ...
0
votes
1answer
289 views

Mail does not work in scripts launched with launchd

I'm using this setup to be able to send mail from Terminal: http://www.anujgakhar.com/2011/12/09/using-macosx-lion-command-line-mail-with-gmail-as-smtp/ It works great, and I can use it in scripts. ...