A system for starting, stopping, and managing automated processes.
22
votes
4answers
18k 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 ...
13
votes
2answers
1k 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?
11
votes
3answers
1k 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 ...
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
1answer
1k 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
3answers
3k 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
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
339 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 ...
5
votes
1answer
734 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
550 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
2k 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
456 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
...
4
votes
2answers
1k 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
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
564 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
3answers
597 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
1answer
5k 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
3answers
815 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 ...
3
votes
2answers
497 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
1answer
250 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?
3
votes
1answer
572 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 ...
3
votes
2answers
2k 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
2answers
712 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?
3
votes
1answer
166 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 ...
2
votes
1answer
3k 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 ...
2
votes
2answers
899 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
251 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 ...
2
votes
5answers
793 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 ...
2
votes
1answer
501 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
2answers
320 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 ...
2
votes
1answer
68 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
1answer
924 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
1k 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 ...
2
votes
1answer
68 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.
...
2
votes
1answer
539 views
Lingon open source version for editing launchd on Leopard (10.5)?
I'm looking for a free GUI app to help run programs on a schedule. It seems that launchd is the underlying tool to use, and in the past Lingon has been recommended as a good GUI interface to launchd.
...
2
votes
0answers
15 views
How can I shut down an unlisted php-fpm?
I have two installations of php on my machine.
One came with apache and is a 5.3 version, and I'm trying to use a 5.4 version with nginx.
I'd like to work on project using nginx, but I can't figure ...
2
votes
2answers
60 views
Running Growl without a user logged into a graphical session?
I currently have an OS X server (running 10.8.2) that has irssi installed, and is set up to send Growl notifications to my laptop when I am mentioned or have received a private message on IRC. ...
2
votes
0answers
86 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 ...
1
vote
4answers
4k 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 ...
1
vote
2answers
82 views
How can I remove remnant processes from deleted preference panes?
I discovered in Activity Monitor that I have several leftover processes running in the background that shouldn't be there anymore. I deleted these preference panes long ago with an application that ...
1
vote
1answer
766 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
3answers
74 views
Login items with niceness other than 0
I have quite a few login items on my Mac, mostly Apps that I want to have idling in the background (like Tweetbot or Reeder), but that I don't use immediately. I would like to give these Apps an ...
1
vote
1answer
264 views
Need to know what's the contents of /var/db/launchd.db/com.apple.launchd/overrides.plist from Mac OS X Mountain Lion?
I accidentally issued the following command:
# launchctl load -w /System/Library/LaunchDaemons/
I wish to see outputs of mac os x mountain lion launchd% list command. See below on pastie the current ...
1
vote
1answer
114 views
Is it possible to load non-default launchd plist files from the /etc configuration file?
I created the /etc/launchd.conf file but at start the content is never read.
The content of launchd.conf is: load /System/Library/LaunchDaemons/KillVuze.plist
(I run on OSX 10.7.2 )
If I load the ...
1
vote
3answers
446 views
To to disable a service form OS X by using recovery console?
I cannot boot my system anymore and I want to disable a service from loading and the only way to do this by using the terminal window from the recovery mode.
launchctl is not available in the ...
1
vote
1answer
163 views
How do I turn the echo service on in Snow Leopard?
I'd like to temporarily turn on the echo service (TCP and UDP port 7) on in Mac OS 10.6 (Snow Leopard). I guess this involves using the launchctl/launchd?
1
vote
1answer
2k views
How to control apache service on OS X (start/stop/restart/graceful restart)?
I have Apache installed on OS X and I want to know what command I can use to:
start apache
stop apache
restart apache
gracefully restart apache
Also I want to know if the commands were successful ...
1
vote
2answers
420 views
How can I break a persistent association between .xcodeproj files and Xcode 4.2 beta?
I've got Xcode 4.0.2 installed in /Developer, and the Xcode 4.2 beta in /XcodeBeta. My problem is that the .xcodeproj file type is now associated with Xcode 4.2 and I can't change it to Xcode 4.0.2.
...
1
vote
1answer
673 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?
...
1
vote
3answers
105 views
How do I schedule a root command to run at intervals?
I need to run a script in intervals that requires a root user to execute. I created a plist that will call a script in ~/bin/test.sh.
user@MBP:~$ ls -lah ~/bin/
-rw-r--r-- 1 root staff 566B ...

