Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to set up transmission-daemon on a box running Mac OS 10.5.8. I want to do things the right way, which means (to my understanding)

  1. create a service user (_transmission, for example) for the program to run under
  2. create a launchd UserAgent .plist to run transmission-daemon at system start-up, and to keep it running
  3. configure transmission-daemon

I think I've done step 1 correctly. I used dscl and referenced this question on serverfault to create a user called _transmission. Here's my setup:

$ dscl . -read /Users/_transmission
 AppleMetaNodeLocation: /Local/Default
 GeneratedUID: 31D12B9E-EA47-4595-BFC4-57EB232C3B33
 NFSHomeDirectory: /var/transmission
 Password: *
 PrimaryGroupID: 1001
 RealName:
  Transmission bittorrent daemon
 RecordName: _transmission
 RecordType: dsRecTypeStandard:Users
 UniqueID: 1001
 UserShell: /usr/bin/false

That seems OK. However, I can't get my launchd UserAgent to run the daemon. Here's my attempt at a .plist. Transmission doesn't run after I call launchctl load -w /Library/LaunchAgents/com.transmissionbt.transmission-daemon

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
    <key>TRANSMISSION_WEB_HOME</key>
    <string>/var/transmission/Web</string>
</dict>
<key>Label</key>
<string>com.transmissionbt.transmission-daemon</string>
<key>OnDemand</key>
<false/>
<key>Program</key>
<string>/usr/sbin/transmission-daemon</string>
<key>ProgramArguments</key>
<array>
    <string>transmission-daemon</string>
    <string>-f</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>Transmission-Daemon bittorrent client</string>
<key>UserName</key>
<string>_transmission</string>
</dict>
</plist>

So my question is two-fold:

  1. What is the best way to create daemon service users on OS X?
  2. Why isn't my launchd LaunchAgent .plist working?
share|improve this question
    
launchd problems are available in /Application/Utilities/Console.app. –  Daniel Beck Jan 20 '11 at 11:07
    
launchd doesn't seem to be reporting any problems. transmission-daemon just isn't launching. –  Just Jake Jan 21 '11 at 7:23
    
Launch agents are started when there's an interactive session for a user AFAIK. Have you tried making it a launch daemon? –  Daniel Beck Jan 9 '12 at 6:09

1 Answer 1

This is just a guess, but according to the manpage "UserName " is only applicable when launchd is running as root.

try unloading the plist if it's already running:

launchctl unload /Library/LaunchAgents/com.transmissionbt.transmission-daemon

and then run as root:

sudo launchctl load -w /Library/LaunchAgents/com.transmissionbt.transmission-daemon

Can you confirm that it actually loads:

launchctl list | grep transmissionbt

Let me know if this works out for ya.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.