<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>rcng &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/rcng/</link>
	<description>Feed of posts on WordPress.com tagged "rcng"</description>
	<pubDate>Wed, 02 Dec 2009 03:06:22 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Avviare rtorrent al boot su FreeBSD]]></title>
<link>http://emanuelecipolla.net/2008/08/26/avviare-rtorrent-al-boot-su-freebsd/</link>
<pubDate>Tue, 26 Aug 2008 11:10:21 +0000</pubDate>
<dc:creator>Emanuele Cipolla</dc:creator>
<guid>http://emanuelecipolla.net/2008/08/26/avviare-rtorrent-al-boot-su-freebsd/</guid>
<description><![CDATA[rtorrent è un client BitTorrent con interfaccia testuale molto leggero che può essere lanciato in ba]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;"><a title="The libTorrent and rTorrent project" href="http://libtorrent.rakshasa.no/">rtorrent</a> è un client BitTorrent con interfaccia testuale molto leggero che può essere lanciato in background con l&#8217;ausilio di <a title="GNU Screen" href="http://www.gnu.org/software/screen/">screen</a> o <a title="dtach" href="http://dtach.sourceforge.net/">dtach</a>. Persino la wiki ufficiale del progetto <a title="RTorrentCommonTasks - Starting rTorrent on System Startup" href="http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks#StartingrTorrentonSystemStartup">suggerisce</a> esplicitamente come si possa avviare il programma automaticamente al boot su un sistema GNU/Linux.</p>
<p style="text-align:justify;">Sia rtorrent che screen/dtach funzionano perfettamente anche su FreeBSD: manca però un script di init funzionante.</p>
<p style="text-align:justify;">Quel che segue è un tentativo in tal senso che dovrebbe soddisfare le esigenze di un buon numero di utenti; le differenze rispetto ai suoi omologhi per GNU/Linux riguardano principalmente i parametri di lancio: ritengo che uno script di init non debba essere un secondo file di configurazione, che, nella fattispecie, è <em>.rtorrent.rc</em>.</p>
<p style="text-align:justify;">Segue il contenuto dello script. Per utilizzarlo, piazzatelo in /usr/local/etc/rc.d/rtorrent e dategli i permessi di esecuzione con <em>chmod +x /usr/local/etc/rc.d/rtorrent</em>.</p>
<p style="text-align:justify;">
<pre class="brush: php;">#!/bin/sh
#
# rtorrent RCng startup script
# by Emanuele Cipolla (mail at emanuelecipolla dot net)
# Shamelessly ripped off the aMule startup script by Gabriele Cecchetti (amule.org forum)
# 

# PROVIDE: rtorrent
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable rtorrent at startup
# rtorrent (bool): Set to &quot;NO&quot; by default.
#                Set it to &quot;YES&quot; to enable rtorrent
# rtorrent_user (str): Set to user running rtorrent
#                    (default 'rtorrent')
# rtorrent_home (str): Set to home directory of user running rtorrent
#                    (default /home/${rtorrent_user})

. /etc/rc.subr

name=&quot;rtorrent&quot;
rcvar=`set_rcvar`

load_rc_config $name

[ -z &quot;$rtorrent_enable&quot; ] &amp;&amp; rtorrent_enable=&quot;NO&quot;
[ -z &quot;$rtorrent_user&quot; ] &amp;&amp; rtorrent_user=&quot;rtorrent&quot;
[ -z &quot;$rtorrent_home&quot; ] &amp;&amp; rtorrent_home=&quot;/home/${rtorrent_user}&quot;

required_dirs=${rtorrent_home}
required_files=&quot;${rtorrent_home}/.rtorrent.rc&quot;

start_cmd=&quot;${name}_start&quot;
stop_cmd=&quot;${name}_stop&quot;

rtorrent_start()
{
        if [ ! -f /var/run/${name}.run ]
        then
      cd ${rtorrent_home}
       su ${rtorrent_user} -c &quot;/usr/local/bin/screen -dmS rtorrent_init /usr/local/bin/rtorrent&quot;
      touch /var/run/${name}.run
          echo &quot;Started ${name}.&quot;
          echo `date` : &quot;Started ${name}.&quot; &gt;&gt; /var/log/${name}.log
        else
          echo &quot;${name} seems to be already running -- remove /var/run/${name}.run manually if needed.&quot;
        fi
}

rtorrent_stop()
{
        if [ -f /var/run/${name}.run ]
        then
          killall -INT $(echo -n 'ps aux &amp;#124; grep rtorrent &amp;#124; grep -v rtorrent_init') 2&gt;&gt;/var/log/${name}.log &gt;&gt;/var/log/${name}.log
          rm -f /var/run/${name}.run
          echo &quot;Stopped ${name}.&quot;
          echo `date` : &quot;Stopped ${name}.&quot; &gt;&gt; /var/log/${name}.log
        else
          echo &quot;${name} doesn't seem to be running -- create /var/run/${name}.run if needed.&quot;
        fi
}

run_rc_command &quot;$1&quot;</pre>
</div>]]></content:encoded>
</item>

</channel>
</rss>
