Tag Info

Hot answers tagged

40

If a plist is owned by root and writable by a user other than root, that's a security issue. You can change the owner to root with sudo chown root <filename>, and change the permissions with sudo chmod 644 <filename> (4 for read access, 2 for write access, 1 for execute access, added up. The first number is for the owner, the second for the ...


26

I'm assuming the paths to the python script and its parameters are valid, otherwise you'd most likely be seeing errors in the Console instead. The last time I saw that error was because there were spurious characters in the plist, e.g. extra spaces, causing syntax errors and therefore making it fail to load. If you run plutil -lint on your plist, this will ...


24

I've seen this too. Emacs 24.3.1, Mavericks 10.9. I've found that the distnoted process calms down within seconds after I quit out of Emacs. I've filed an Emacs bug here: http://permalink.gmane.org/gmane.emacs.bugs/80836


18

Appplescript & iCal Open Applescript and enter the following code: tell application "Finder" delete folder "folder" of home end tell Replacing folder with the folder you want to delete, and save the file. If the folder you want to delete is outside home directory, (for example the folder /Users) then replace the delete line with: delete folder ...


17

I know I'm late to the party but this is a memory leak specific to Cocoa emacs on Mavericks that is fixed in the trunk. For now there is a patch you can use to build emacs 24.3 with just the fix. https://gist.github.com/anonymous/8553178


16

With the release of Mac OS 10.4, launchd was chosen to supersede cron in Mac OS. Here's a cached version of the launchd page from the Apple Developer Connection in 2005. It explains why cron was deprecated, as well as the benefits of launchd from Apple's perspective. The summary: launchd was created to not just replace cron but also init, xinetd for better ...


14

Okay, I found a solution... Chris Johnsen has a good writeup of what causes this problem on github. His tools work, but a better solution, if you have homebrew installed to: brew install reattach-to-user-namespace Then in your ~/.tmux.conf add these lines: set-option -g default-command "reattach-to-user-namespace -l zsh" # or bash bind C-c run "tmux ...


12

From the launchctl(1) manpage’s description of the load subcommand: Note that per-user configuration files (LaunchAgents) must be owned by the user loading them. All system-wide daemons (LaunchDaemons) must be owned by root. Configuration files must not be group- or world-writable. These restrictions are in ...


10

The immediate problem is that your .plist file isn't correctly formatted -- the contents of <string>...</string> should be encoded with HTML entities, i.e. & needs to be encoded as &amp; (note: you can check the format of .plist files with plutil -lint filename.plist). But there are some other changes that need to be made... Starting ...


10

launchd runs Daemons (/Library/LaunchDaemons or /System/Library/LaunchDaemons) as root, and will run them regardless of whether users are logged in or not. Launch Agents (/Library/LaunchAgents/ or ~/Library/LaunchAgents/) are run when a user is logged in as that user. You can not use setuid to change the user running the script on daemons. The /System ...


10

Summary from the OP: this was a great tool for debugging. it originally pointed me to Spotlight reindexing the filesystem, but I narrowed down the things it's allowed to index, and I still saw the problem. I ended up setting up a cron job to kill distnoted regularly. See answer farther down. You can debug distnoted by creating the file ...


9

EnableGlobbing enables tilde and wildcard expansion for ProgramArguments: <key>EnableGlobbing</key> <true/> <key>ProgramArguments</key> <array> <string>say</string> <string>~/*</string> </array> It doesn't affect Program or WatchPaths, but tilde expansion works in WatchPaths by ...


9

The wikipedia article on launchd has a very good summary, extended discussions as well as some great videos and external links for a deeper dive into this decision by Apple. In a nutshell, launchd replaces 7 major tasks and a boatload of scripts (inetd, init and rc and associated shell script structures, crond, atd, watchdogd, SystemStarter) with one much ...


8

For anyone who ends up on this page, I realized I should post the answer: Using launchd instead of cron does indeed fix the authorization problem. Your user launchd jobs (which run only when you are logged in) correctly use the SSH agent information that was unlocked via your keychain as part of login (as part of standard OS X key management, no other ...


7

If you want to use a software, you can try Lingon. It allows you to manage (create, edit, delete) all the launchd items on your system. Otherwise, if you want to go by hand, look inside the following folders : /Library/LaunchAgents /Library/LaunchDaemons ~/Library/LaunchAgents


7

You can boot into single user mode by holding Command + s at startup. Single user mode starts you directly at the console, bypassing core Mac OS X startup processes. You should be able to remove or alter the offending file from there.


6

You could write a launchd script to do it. Launchd can watch for applications and restart them if they disappear. I might have one somewhere if you are interested. Updated with an example... See mankoff's example. Here's mine, it's slightly different but works the same... <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC ...


6

The way I understand it, that System folder launchd job does nothing but execute /usr/libexec/locate.updatedb itself. So simply create your own launchd job executing /usr/libexec/locate.updatedb that runs once a day. As a sidenote, here's a Super User answer which recommends using mdfind -name <filename> instead of locate so that you can use the ...


6

Launchd will run your jobs next time the mac wakes from sleep. So if you shut down your mac, this won't work. You will need to put your mac to sleep to get your daily script to run when the mac wakes if the last time it should have run was during the sleep duration. man launchd.plist: If the system is asleep, the job will be started the next time ...


6

Launchd and Folder Actions are two vastly different concepts. Folder Actions Folder Actions allow you to attach actions in the form of Apple Scripts folders which get triggered if the content of the folder changes. Typical use cases are e.g. a folder to auto-upload photos to a website removal of file attributes (e.g. the "downloaded" attribute) ...


6

To start screensharing: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist To stop: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.screensharing.plist The -w flag modifies the Disabled key as appropriate. It's best to let launchctl handle this, as the location where the config files are stored has ...


5

The manual method (Lingon in Studer's question is a great GUI for this) is to unload the job from launchd: Run sudo launchctl stop com.jungledisk.workgroupservice to tell launchd to stop running the job but it's important to note the job will just come back the next time you restart. You can then try and track down the file in /Library/LaunchAgents, ...


5

The launchd GUI LaunchControl will give you a list of services along with their respective status. You can see if a job has been disabled by looking at the check box next to the job name. A colored check box indicates that the Disabled key has been overridden: a red checkbox stands for a permanently disabled job, a green one for a permanently enabled job.


5

That isn't actually launchctl creating a new process; it's most likely dnsmasq itself. If it fork()s into the background, launchd can't tell; then when it talks to launchd, launchd creates an anonymous entry for it. Make sure dnsmasq doesn't background itself. (The - listed for the regular launchctl list output indicates that the original dnsmasq process ...


5

If you want to stop the item for this boot simply issue an unload command to launchd via launchctl. For a permanent fix add a disabled key into the plist with value true or delete/move the file to a folder where launchd will not scan it automatically. launchctl unload /System/Library/LaunchAgents/com.apple.AppStoreUpdateAgent.plist The man page for ...


5

Adding the following code to your bash shell script will fix the problem: declare -x SSH_AUTH_SOCK=$( find /tmp/launch-*/Listeners -user your_user -type s | head -1 ) Replace "your_user" with your own user name. This code sets the correct value for SSH_AUTH_SOCK that informs "ssh" or "scp" about how to communicate with "ssh-agent" when the shell script ...


5

There is no way to bypass or decrease the time limit. Apple's documentation regarding Creating Launchd Jobs states the following: Important If your daemon shuts down too quickly after being launched, launchd may think it has crashed. Daemons that continue this behavior may be suspended and not launched again when future requests arrive. To avoid ...


5

I'd rather have this a comment, but for some reason I can only post answers. Have a look at LaunchControl: http://www.soma-zone.com/LaunchControl/. While it does not offer a menu item to start/stop services it provides a list of all available launchd jobs, their current status and a way to start/stop them with the click of a button.


5

i gave up and took the sledgehammer approach: kill it automatically, every minute. sigh. i put this in ~/Library/LaunchAgents/org.snarfed.pkill_distnoted.plist: <plist version="1.0"> <dict> <key>Label</key> <string>org.snarfed.pkill_distnoted</string> <key>ProgramArguments</key> <array> ...



Only top voted, non community-wiki answers of a minimum length are eligible