Need some help setting up transmission-daemon on my server

Ask for help and report issues with the Mac OS X version of Transmission
Post Reply
serversurfer
Posts: 15
Joined: Mon Jan 10, 2011 11:06 am

Need some help setting up transmission-daemon on my server

Post by serversurfer »

Okay, I'm trying to transition from using Transmission.app on my MacBook to using transmission-daemon on my iMac, using the 'Book to puppet the daemon, and I'm having some issues. Sorry if most/all of this has been covered before, but I wasn't having much luck searching the forums.

First, when I try to set up transmission-daemon as a LaunchDaemon, it just spawns out of control, eventually preventing me from starting any other processes on the iMac. Here's the plist I'm using to set it up:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
        <dict>
                <key>KeepAlive</key>
                        <dict>
                                <key>NetworkState</key>
                                        <true/>
                        </dict>
                <key>Label</key>
                        <string>com.transmission.daemon</string>
                <key>UserName</key>
                        <string>surfer</string>
                <key>GroupName</key>
                        <string>staff</string>
                <key>ProgramArguments</key>
                        <array>
                                <string>/.sw/bin/transmission-daemon</string>
                                <string>--config-dir</string>
                                <string>/Users/surfer/.config/transmission-daemon</string>
                        </array>
                <key>RunAtLoad</key>
                        <true/>
                <key>StandardErrorPath</key>
                        <string>/dev/null</string>
                <key>StandardOutPath</key>
                        <string>/dev/null</string>
        </dict>
</plist>
Is the problem with the KeepAlive key? My goal was to ensure that transmission-daemon kept running as long as the network was available. I know that by nature, transmission-daemon spawns multiple, short-lived instances of itself. Is that confusing the KeepAlive, which just launches a new batch of daemons every time one of them dies? If so, what's the proper way to ensure the daemon keeps running if it should die completely? It seems to behave properly if I launch it manually in the foreground, so the issue seems to be with setting it up as a LaunchDaemon.

Second, I can't get it to honor the watch-dir. When I launch the daemon in the foreground, I see this:

Code: Select all

[14:55:03.054] Watching "/Users/surfer/Downloads" for new .torrent files (/Users/surfer/Downloads/Transmission/daemon/daemon.c:515)
[14:55:03.054] Using readdir to watch directory "/Users/surfer/Downloads" (/Users/surfer/Downloads/Transmission/daemon/watch.c:161)
… which would seem to indicate that it's trying to watch the right directory, but whenever I drop a .torrent in that folder (on the iMac) from the 'Book using the Finder, it never adds the .torrent like it should. (It also doesn't trash the .torrent, but I'm guessing that solving the former issue will also solve the latter.) Manually adding the .torrent using transmission-remote -a works as expected.

Anyone have any ideas on how to solve either/both of these issues?
serversurfer
Posts: 15
Joined: Mon Jan 10, 2011 11:06 am

Re: Need some help setting up transmission-daemon on my serv

Post by serversurfer »

Thanks for the reply.
x190 wrote:Doesn't OS X use /Users/surfer/Library/Application Support/Transmission or [transmission-daemon] and also use a plist for settings (~/Library/Preferences/org.m0k.transmission.plist)?
I'm not sure about the locations you mentioned, but I think I got the one I'm using from the man page. Anyway, it doesn't seem to have a problem reading settings from the JSOM; AFAICT it thinks it's monitoring the proper directory, but it just doesn't seem to actually do so.

I've seen others having issues using the defaults system—not reading the location of the post-processing script, etc.—so I just skipped that and went straight to the JSOM.
Also you could add a Throttle Respawn key:value (launchd) to slow it down a bit (just a guess :) ).

https://trac.transmissionbt.com/wiki/ConfigFiles
I'm not seeing that key in the docs you linked. Also, as I said, it seems well-behaved when I manually launch the daemon. It's only when launchd launches it that it spawns out of control, so the problem seems to stem from there (somewhere).
serversurfer
Posts: 15
Joined: Mon Jan 10, 2011 11:06 am

Re: Need some help setting up transmission-daemon on my serv

Post by serversurfer »

Code: Select all

TheChipmunks:~ surfer$ defaults read org.m0k.transmission
{
    AutoImport = 1;
    AutoImportDirectory = "/Users/surfer/Downloads";
[snip]
Looks like it's set up correctly in defaults as well as the JSON.

And as I said, when I launch the daemon, it explicitly tells me it's monitoring /Users/surfer/Downloads for new .torrent files. It just doesn't seem to actually be doing so.
serversurfer
Posts: 15
Joined: Mon Jan 10, 2011 11:06 am

Re: Need some help setting up transmission-daemon on my serv

Post by serversurfer »

Good guess, but no. Downloads go to /Users/surfer/Downloads/Torrents/ which is the same configuration I used in the .app.

The Fink version just got updated to 2.13, so maybe I'll give that a try and see if it helps. Perhaps I managed to mess up the build (though it seemed like a pretty straightforward process).

I'll post back later.
serversurfer
Posts: 15
Joined: Mon Jan 10, 2011 11:06 am

Re: Need some help setting up transmission-daemon on my serv

Post by serversurfer »

woot

I installed 2.13 via fink and now watch-dir is working as it should. It even trashes the .torrent files after adding them. When I installed it, I noticed that fink included libevent, which I'm guessing is needed to make the watch-dir thing actually realize something has changed.

Now I just need to figure out how to get the daemon to play nice with launchd. I'll post back when I have some progress (or a lack thereof :P).
serversurfer
Posts: 15
Joined: Mon Jan 10, 2011 11:06 am

Re: Need some help setting up transmission-daemon on my serv

Post by serversurfer »

Well, that was simple enough. Eliminating the KeepAlive key seems to have tamed the daemon.

Now we'll just hope that the daemon is stable/tenacious enough to keep itself alive. /me knocks wood.
serversurfer
Posts: 15
Joined: Mon Jan 10, 2011 11:06 am

Re: Need some help setting up transmission-daemon on my serv

Post by serversurfer »

Oh, and FWIW, when I ran the finked version of the daemon with no arguments, it looked to ~/.config/transmission-daemon/ for its config files, so no trouble there either. :)
serversurfer
Posts: 15
Joined: Mon Jan 10, 2011 11:06 am

Re: Need some help setting up transmission-daemon on my serv

Post by serversurfer »

Sure, I can do that. I'll post a link after I finish it up. :)
serversurfer
Posts: 15
Joined: Mon Jan 10, 2011 11:06 am

Re: Need some help setting up transmission-daemon on my serv

Post by serversurfer »

Err, how do I make a wiki page?

The instructions say that I should start by linking to it from an existing page. I was going to link it under More Documentation on WikiStart, but I can't figure out how to edit WikiStart to make the link. :?
simonpie
Posts: 8
Joined: Tue Feb 24, 2009 4:50 pm

Re: Need some help setting up transmission-daemon on my serv

Post by simonpie »

I had the same problem with transmission daemon.

I did tame the daemon by removing keepalive, but saddly, it crashes sometimes. Bummer.

For the watch directory, well just pass the flag ,"-c", to the daemon. It does not seem to obey the json configuration file.

Here is my plist for lauchctl which works fine

Code: Select all

<?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>Label</key>
        <string>TransmissionBT</string>
        <key>ProgramArguments</key>
        <array>
                <string>/Network/Servers/Boo.crypto.lan/Volumes/Crypto/Labo/blablabla/.bin/transmission-2.22/daemon/transmission-daemon</string>
                <string>-c</string>
                <string>/Network/Servers/Boo.crypto.lan/Volumes/Crypto/Labo/blablabla/Movies/AFaire/</string>                 
                <string>-g</string>
                <string>/Network/Servers/Boo.crypto.lan/Volumes/Crypto/Labo/blablabla/.config/transmission-daemon/</string>
                <string>-e</string>
                <string>/Network/Servers/Boo.crypto.lan/Volumes/Crypto/Labo/blablabla/.bin/TransmissionBT.log</string>
        </array>
                        
        <key>RunAtLoad</key>
        <true/>
        <key>UserName</key>
        <string>blablabla</string>
        <key>StandardErrorPath</key>
        <string>/Network/Servers/Boo.crypto.lan/Volumes/Crypto/Labo/blablabla/.bin/TransmissionBT.log</string>
        <key>StandardOutPath</key>
        <string>/Network/Servers/Boo.crypto.lan/Volumes/Crypto/Labo/blablabla/.bin/TransmissionBT.log</string>
        <key>WorkingDirectory</key>
        <string>/Network/Servers/Boo.crypto.lan/Volumes/Crypto/Labo/blablabla/.config/</string>
        <key>EnvironmentVariables</key>
        <dict>
                <key>TRANSMISSION_WEB_HOME</key>
                <string>/Network/Servers/Boo.crypto.lan/Volumes/Crypto/Labo/blablabla/.bin/transmission-2.22/daemon/endor-kettu-fb805dd/</string>
        </dict>
</dict>
</plist>
Post Reply