1

I'm using an old iMac as a torrent client & Plex Media Server.

But I would like those to run as "services", i.e., not as part of a User account, and without having to log in.

  • Transmission works according to this thread: apple.stackexchange.com/questions/30310/… – bmike Jan 6 '14 at 20:55
  • Services are tasks that can be called from the serve menu in applications. Things that ruin in the background like you say are daemons. – Mark Jan 19 '14 at 10:43
1

You can use launchd, tmux and this script to launch rTorrent as a daemon.

This post describes how to install rTorrent and run it as a daemon using tmux. First, install software:

$brew install rtorrent --with-xmlrpc-c
$brew install tmux

Parameter –with-xmlrpc-c is needed to use GUI clients with rTorrent. rTorrent needs terminal to run. We provide virtual terminal using tmux. To autostart rTorrent create launchd sript and place it to

/Library/LaunchAgents/rtorrent.plist

The script:

<?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>rtorrent</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/tmux</string>
        <string>new-session</string>
        <string>-s</string>
        <string>rtorrent</string>
        <string>-d</string>
        <string>rtorrent</string>
    </array>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>

Load script:

$sudo launchctl load -w /Library/LaunchAgents/rtorrent.plist
$launchctl list | grep rtorrent

If all is ok you will see something like this:

- 1 rtorrent
4868 - 0x7f872252ff90.anonymous.rtorrent

Now you can attach to tmux session and start using rTorrent:

$tmux attach-session -t rtorrent

To restart script unload it and load again:

$sudo launchctl unload -w /Library/LaunchAgents/rtorrent.plist
$sudo launchctl load -w /Library/LaunchAgents/rtorrent.plist

To view launchd logs run:

$sudo launchctl log level debug
$tail -f /var/log/system.log | grep launchd

The rTorrent installation is over, now you can install GUI client. There is free client for Mac OS X called Nativa. It not very good, but you can try it. To use any client you need to add this in your .rtorrent.rc:

scgi_port = 127.0.0.1:5000

Source

  • I have added the step from your source to the answer posted. In the future, please don't simply link offsite. We like answers to be complete and robust, not just links to other places on the net. This isn't Google. Many thanks for contributing. – user10355 Jan 19 '14 at 9:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .