SERVER : TorrentFlux and MRTG for TorrentFlux problems.
Thursday, January 11, 2007 3:32:24 PM
I've ran into some problems, and i thought I'd share how i fixed them.
:idea:First of all, i had to restart the server, and after that the graphs in MRTG didn't want to update anymore. After a while I've discovered that there's a folder missing, the /var/lock/mrtg folder. This is the folder that mrtg writes its lock file (the file used to know it's running, so only 1 instance can run at a time).
In order to recreate it here's what i did :
sudo mkdir /var/lock/mrtg sudo chown www-data:www-data /var/lock/mrtg sudo chmod 777 /var/lock/mrtg
Now, since it seems that I have to run this each time I reboot the computer, its better to put it in the /etc/rc.local file, so just run
sudo editor /etc/rc.localand insert the above lines before the exit 0 line.
Here's my file as it looks like now :
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. # start No-Ip so that my web-name is updated correctly /usr/local/bin/noip2 # create the lock file for MRTG, it seems to get lost each time i restart the computer mkdir /var/lock/mrtg chown www-data:www-data /var/lock/mrtg chmod 777 /var/lock/mrtg # start IPKungfu, so port forwarding and gateway work correctly /usr/sbin/ipkungfu exit 0
:idea:Second problem was that I've managed to block TorrentFlux so badly that i wasn't even able to log in. I've tried restarting the Apache server but that didn't help, so when I was about to give up on TorrentFlux (and that would have been a shame) I've found out how to fix my problem.
Luckily, the developers of TorrentFlux included a little application that can be used from the console to control TorrentFlux. The application's name is fluxcli.
First thing was that I needed to find where it is, for that use this :
locate fluxcli.php, you should get something similar to this :
/var/www/torrentflux/bin/fluxcli.php
Now that we know where it is, lets execute it, for that do this :
cd /var/www/torrentflux/bin php fluxcli.php repair
FluxCLI can be used for other things too, for example you can start/stop torrents.
If you want to see what exactly fluxcli can do, just run it without commands, you should see something similar to this :
fluxcli.php Revision 1958
Usage: fluxcli.php action [extra-args]
action:
<transfers> : print transfers.
<netstat> : print netstat.
<start> : start a transfer.
extra-arg : name of transfer as known inside torrentflux
<stop> : stop a transfer.
extra-arg : name of transfer as known inside torrentflux
<start-all> : start all transfers.
<resume-all> : resume all transfers.
<stop-all> : stop all running transfers.
<reset> : reset totals of a transfer.
extra-arg : name of transfer as known inside torrentflux
<delete> : delete a transfer.
extra-arg : name of transfer as known inside torrentflux
<wipe> : reset totals, delete torrent, delete torrent-data.
extra-arg : name of torrent as known inside torrentflux
<inject> : injects a transfer-file into tflux.
extra-arg 1 : path to transfer-meta-file
extra-arg 2 : username of fluxuser
<watch> : watch a dir and inject+start transfers into tflux.
extra-arg 1 : path to users watch-dir
extra-arg 2 : username of fluxuser
<rss> : download torrents matching filter-rules from a rss-feed.
extra-arg 1 : save-dir
extra-arg 2 : filter-file
extra-arg 3 : history-file
extra-arg 4 : rss-feed-url
<xfer> : xfer-Limit-Shutdown. stop all transfers if xfer-limit is met.
extra-arg 1 : time-delta of xfer to use : <all|total|month|week|day>
<repair> : repair of torrentflux. DONT do this unless you have to.
Doing this on a running ok flux _will_ screw up things.
<maintenance> : call maintenance and repair all died transfers.
extra-arg 1 : restart died transfers (true/false)
<dump> : dump database.
extra-arg 1 : type : settings/users
<filelist> : print file-list.
extra-arg 1 : dir (if empty docroot is used)
<checksums> : print checksum-list.
extra-arg 1 : dir (if empty docroot is used)
examples:
fluxcli.php transfers
fluxcli.php netstat
fluxcli.php start foo.torrent
fluxcli.php stop foo.torrent
fluxcli.php start-all
fluxcli.php resume-all
fluxcli.php stop-all
fluxcli.php reset foo.torrent
fluxcli.php delete foo.torrent
fluxcli.php wipe foo.torrent
fluxcli.php inject /path/to/foo.torrent fluxuser
fluxcli.php watch /path/to/watch-dir/ fluxuser
fluxcli.php rss /path/to/rss-torrents/ /path/to/filter.dat /path/to/filter.hist http://www.example.com/rss.xml
fluxcli.php xfer month
fluxcli.php repair
fluxcli.php maintenance true
fluxcli.php dump settings
fluxcli.php dump users
fluxcli.php filelist /var/www
fluxcli.php checksums /var/www
As you can see, it states clearly that you should not run fluxcli repair unless you really have to. So unless you get blocked out or something just dont use it
I had to use it since I wasn't even able to log in, and it did repair my torrentflux. THe only thing is that i had to restart all torrents, but that was to be expected.Happy downloding and graphing:cool:




























