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)
- create a service user (_transmission, for example) for the program to run under
- create a launchd UserAgent .plist to run
transmission-daemonat system start-up, and to keep it running
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:
- What is the best way to create daemon service users on OS X?
- Why isn't my launchd LaunchAgent .plist working?