Transmission Plugin for UnRaid v5b11+


Recommended Posts

Please can the log be separated from the the common /var/log/syslog (plus handled with the cron rotation)? It makes the latter unreadable.

I don't think so.  The log file for Transmission can not be controlled last i checked so it automatically writes to the syslog.  If you want this changed (like what sabnzbd, sickbeard, etc do) then talk to the Transmission devs

Link to comment
  • Replies 188
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

i try find time to compile in weekend 2.60 or little more fresh (from SVN if have some important fix from 2.60)

 

Piotrasd, I got a question about your transmission plugin.

 

The 'transmission_stop()' function in the plugin kills the pid of transmission, but it does not delete the .pid file... and you have a while loop there that waits until .pid is getting deleted...

 

This can cause a problem if someone was to stop and restart the service. (Like me).

 

You may want to fix this in the next version.

Link to comment

i try find time to compile in weekend 2.60 or little more fresh (from SVN if have some important fix from 2.60)

 

Piotrasd, I got a question about your transmission plugin.

 

The 'transmission_stop()' function in the plugin kills the pid of transmission, but it does not delete the .pid file... and you have a while loop there that waits until .pid is getting deleted...

 

This can cause a problem if someone was to stop and restart the service. (Like me).

 

You may want to fix this in the next version.

killing of the transmission process should delete that .pid file.

Link to comment

killing of the transmission process should delete that .pid file.

 

Hmm maybe there was something wrong on my side then. For me it just sat there until I deleted the pid file.

 

ohwell

It might be something on the Transmission side.  I know that other applications that intercept the kill command will delete the .pid file in the "cleanup" process as the app is shutting down.

 

The only thing that i can think that might be causing this is that wherever the pid file is located is not writable/changable by the user that is running transmission.

 

The directory /var/run/transmission/ has to be readable/writable by the user running transmission.

 

if you are running as nobody then an "ls -al" on /var/run/transmission/ should show that the folder is owned by users:nobody and that the .pid file inside can be changed by that user.

Link to comment

Please can the log be separated from the the common /var/log/syslog (plus handled with the cron rotation)? It makes the latter unreadable.

I don't think so.  The log file for Transmission can not be controlled last i checked so it automatically writes to the syslog.  If you want this changed (like what sabnzbd, sickbeard, etc do) then talk to the Transmission devs

Yes it can. I once had compiled a transmission package myself, with cron job and everything, but when I saw your plugin I deleted it because mine prevented the array from stopping when I needed ( I had to ssh and stop the daemon manually, plugin model wasn't around yet and I was just waiting for somebody to do the porting job :P ).

 

You just need to use "-e /var/log/transmission.log" parameter when invoking the command.

To check all the parameters: "/usr/bin/transmission-daemon --help"

Please add the cron job too ;)

Link to comment

Yes it can. I once had compiled a transmission package myself, with cron job and everything, but when I saw your plugin I deleted it because mine prevented the array from stopping when I needed ( I had to ssh and stop the daemon manually, plugin model wasn't around yet and I was just waiting for somebody to do the porting job :P ).

Learn something new every day.  If that is the case than it should be easy enough to implement, though that is not for me to do as i did not create this plugin, nor do i use it.  I did create the original transmission package used by this plugin but that was it.

 

You just need to use "-e /var/log/transmission.log" parameter when invoking the command.

To check all the parameters: "/usr/bin/transmission-daemon --help"

Please add the cron job too ;)

I would suggest using /var/log/transmission/transmission.log as the /var/log directory is read/write only for the root user.

 

And what is this "cron job" that you speak of?

Link to comment

Ok for the nested path, I don't mind and I didn't know it's only-root accessible.

 

Sorry for the cron reference, my memory is faulty, my bad. I meant logrotate job.

The logrorotate job is useful in order to rotate the log and prevent it from growing excessively.

When I did mine the quota was 1MB, after that, it trashed the current log and began a new one.

Since /var/log is loaded, as everything else, on RAM memory is kind of limited and I wanna keep it in check and available for stuff more useful.

 

In the package you just need to create a etc/logrotate.d/transmission-daemon file with a code that kind of goes like this:

 

/var/log/transmission/transmission.log {
    size 1M
    missingok
    rotate 0
    sharedscripts
    postrotate
if [ -f /var/run/transmission/transmission.pid ]; then
    /etc/rc.d/rc.transmission restart
fi
    endscript
}

 

The postrotate code is important otherwise the new log file won't be recognized.

Obviously the settings can be more complex but I don't see a real need beyond controlling transmission.log growth.

Link to comment

Ok for the nested path, I don't mind and I didn't know it's only-root accessible.

 

Sorry for the cron reference, my memory is faulty, my bad. I meant logrotate job.

The logrorotate job is useful in order to rotate the log and prevent it from growing excessively.

When I did mine the quota was 1MB, after that, it trashed the current log and began a new one.

Since /var/log is loaded, as everything else, on RAM memory is kind of limited and I wanna keep it in check and available for stuff more useful.

 

In the package you just need to create a etc/logrotate.d/transmission-daemon file with a code that kind of goes like this:

 

/var/log/transmission/transmission.log {
    size 1M
    missingok
    rotate 0
    sharedscripts
    postrotate
if [ -f /var/run/transmission/transmission.pid ]; then
    /etc/rc.d/rc.transmission restart
fi
    endscript
}

 

The postrotate code is important otherwise the new log file won't be recognized.

Obviously the settings can be more complex but I don't see a real need beyond controlling transmission.log growth.

 

I've adjusted the plugin I'm using, and it is directing output to a standalone log file.  I've simply copied and pasted your rotation script so it's written to the file you specified, so whether it works or not relies solely on what you wrote (sorry about that - I've not looked how log rotation works). 

 

The file is available here:

 

http://unraid-sureguy.googlecode.com/files/transmission-2.52p-i486-2-logs-redirected.plg

 

I've installed the file;

 

- it survives a reboot

- recreates the requested log file

- is still able to download files

 

So I'm willing to say it works properly with the modifications, although I rarely use torrents, so I don't know how long it will take for me to get 1 MB of transmission logs to see if it rotates properly.  I double checked the code, and it doesn't seem to raise any flags, so I think it should work properly.  Note that during a log rotation with the settings in the plugin, any data in the log will be lost.

 

 

**Edit**

 

I manually filled the log by catting a binary file into the log.  This got the log to 1.3MB.  I then manually ran:

 

/usr/bin/run-parts /etc/cron.daily 1> /dev/null

 

the above is the job that is run daily which calls the log rotate function.  This properly cleared out the transmission.log, and restarted transmission, with transmission now logging to an empty file.

 

Link to comment

Dear Benni-chan and all,

First to thank you for developing Transmission for Unraid.

Currently I am using Unraid 5.0-rc6-r8168-test and after a reboot the plugin doesn't seems to work. I need to reinstall it from Unmenu again in order to start it again.

What do I need to do (Probably some command from the "go" file) so that Transmission starts automatically after every restart of the system?

 

Thanks.

 

Link to comment

Dear Benni-chan and all,

First to thank you for developing Transmission for Unraid.

Currently I am using Unraid 5.0-rc6-r8168-test and after a reboot the plugin doesn't seems to work. I need to reinstall it from Unmenu again in order to start it again.

What do I need to do (Probably some command from the "go" file) so that Transmission starts automatically after every restart of the system?

 

Thanks.

 

Are you using a plugin (.plg file) or installing from unMENU? 

 

If you're using a plugin you should be seeing the plugin on the unRAID web interface, not in unmenu.

Link to comment

I've adjusted the plugin I'm using, and it is directing output to a standalone log file.  I've simply copied and pasted your rotation script so it's written to the file you specified, so whether it works or not relies solely on what you wrote (sorry about that - I've not looked how log rotation works). 

 

The file is available here:

 

http://unraid-sureguy.googlecode.com/files/transmission-2.52p-i486-2-logs-redirected.plg

Many thanks! It works just fine!

Link to comment
  • 2 weeks later...

No matter what I do I can't get the Magnet links to work. DHT is enabled and the port is open. It just hangs at "Magnetized transfer - retrieving metadata (0.00%)"  and the tracker info shows

udp://tracker.openbittorrent.com:80
Announce error: Connection failed - Today 06:51:37 PM
Next announce in 3 minutes, 43 seconds
Last Scrape: N/A

 

Example torrent:

magnet:?xt=urn:btih:4e119a0ecfaa018cda6a9ad23c345ed433c07373&dn=Top+100+CSS+Website+Templates+-+LegalTorrents&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80

Link to comment

That looks like you're failing to connect to that particular tracker.  Any chance you can look for a magnet link for a linux distribution to see if that works?  Preferably one that resides on a different tracker.

 

Assuming you're using the plugin I released I've been able to confirm that magnet links work properly, as long as you have an extension that works properly sending the magnet links to the transmission instance running on unRAID.  My setup is Google Chrome using the Remote Transmission plugin.  I had issues getting FireFox to work, but as I use both browsers using Chrome for this wasn't an issue for me.

Link to comment

I had pasted the magnet link into the web interface. I'll try your suggestion later. I also installed uTorrent last night and the same magnet link kicked off without issue and downloaded so I know I can connect to the tracker from that box, just not in transmission (which I would prefer).

Link to comment

I had pasted the magnet link into the web interface. I'll try your suggestion later. I also installed uTorrent last night and the same magnet link kicked off without issue and downloaded so I know I can connect to the tracker from that box, just not in transmission (which I would prefer).

 

I was able to paste the link you specified into the transmission interface without issue.  If you're using the plugin that I modified, the issue you are experiencing is not with the plugin.  For reference this is the plugin I am currently using:

 

http://code.google.com/p/unraid-sureguy/downloads/detail?name=transmission-2.52p-i486-2-logs-redirected.plg&can=2&q=

Link to comment

I'd love to see this plug in moved over to Influencer's system. But I am happy to see it's finally out of unMenu. Thanks!

 

http://lime-technology.com/forum/index.php?topic=21260.0

 

Even though I'm quasi-supporting this release I'd much rather have Influencer plugin as well.  His plugins are awesome. 

 

The only reason I put this plugin up was because there were issues with other plugins that caused segfaults, and there was no plugin that provided the latest version. 

 

On a project like unRAID creating something for your own needs, and then not making it publicly available doesn't make sense.  There is probably someone out there with more experience that will show you how to do it better, and if that's not the case, someone else that can benefit from what was done.

Link to comment

 

I've adjusted the plugin I'm using, and it is directing output to a standalone log file.  I've simply copied and pasted your rotation script so it's written to the file you specified, so whether it works or not relies solely on what you wrote (sorry about that - I've not looked how log rotation works). 

 

The file is available here:

 

http://unraid-sureguy.googlecode.com/files/transmission-2.52p-i486-2-logs-redirected.plg

 

 

Thank you to Benni-chan, sureguy and any others for supplying a plg-plugin for transmission. I have just tried transmission for the first time and found that the data-directory was not created due to permissions. The user nobody (or other) may not have permissions to create the directory, so I suggest, to add to transmission_enable() creation and setting proper user rights on the data directory. If the directory cannot be created by the transmission daemon the '403: Forbidden-Unauthorized IP Address' - error is reported.

 

Also it would be great if we could disable the whitelist by default when installing transmission for the first time, but I have no idea how to do this, besides supplying an entire settings-file, and that might cause problems with future releases.

 

Cheers Alex

Link to comment

Thank you to Benni-chan, sureguy and any others for supplying a plg-plugin for transmission. I have just tried transmission for the first time and found that the data-directory was not created due to permissions. The user nobody (or other) may not have permissions to create the directory, so I suggest, to add to transmission_enable() creation and setting proper user rights on the data directory. If the directory cannot be created by the transmission daemon the '403: Forbidden-Unauthorized IP Address' - error is reported.

 

Also it would be great if we could disable the whitelist by default when installing transmission for the first time, but I have no idea how to do this, besides supplying an entire settings-file, and that might cause problems with future releases.

 

Cheers Alex

 

I create my data directory in a hidden share on my cache drive, using /mnt/cache/.apps/application.  I know I should be using a cache only share at this point.  But my guess is that many others are either doing what I am doing, or using a cache only share.  Assuming the share or folder is created prior to setting up transmission the transmission daemon should be able to write to the directory properly. 

 

I can look into doing what you're suggesting, but I'm pretty sure this moves me from playing in the kiddie pool, to jumping into shark infested waters.  So my mileage may vary.  I wouldn't get your hopes up, as time is limited, but I'll look into it and see if I can figure something out users in your situation.

 

Out of curiosity am I correct that you didn't create a cache only share, or created a directory without chowning it (perhaps on a data disk)?

Link to comment

I create my data directory in a hidden share on my cache drive, using /mnt/cache/.apps/application.  I know I should be using a cache only share at this point.  But my guess is that many others are either doing what I am doing, or using a cache only share.  Assuming the share or folder is created prior to setting up transmission the transmission daemon should be able to write to the directory properly. 

 

I can look into doing what you're suggesting, but I'm pretty sure this moves me from playing in the kiddie pool, to jumping into shark infested waters.  So my mileage may vary.  I wouldn't get your hopes up, as time is limited, but I'll look into it and see if I can figure something out users in your situation.

 

Out of curiosity am I correct that you didn't create a cache only share, or created a directory without chowning it (perhaps on a data disk)?

Not sure if it will help you but my original unMenu package does allow the changing/customization of all the settings.json stuff.  Might be able to look at that one or the Sab/Sickbeard plugins

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.