Ted

Meet ted! Your new way of downloading tv shows from the web!

Add your favourite tv shows to ted and ted will automatically download torrents of new episodes!
| Tasklist |

FS#258 - Start ted as a daemon

Attached to Project: Ted
Opened by Jofo (JoFo) - Thursday, 19 March 2009, 21:36 GMT+2
Last edited by Jofo (JoFo) - Thursday, 09 July 2009, 21:48 GMT+2
Task Type Feature Request
Category Backend / Core
Status Assigned
Assigned To Gonçalo (gedl)
Operating System Linux
Severity High
Priority Normal
Reported Version Development
Due in Version 0.98
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

This task is for the already started implementation of running ted as a daemon on Linux
This task depends upon

Comment by Jofo (JoFo) - Thursday, 19 March 2009, 21:37 GMT+2
A friend of mine tested the daemon on Linux and it gave him the following error:
david:~/tedv096$ java -cp ted.jar ted.headless.Daemon

java.io.FileNotFoundException: /home/david/ted/30.rock-s3_e14.torrent (No such file or directory)

at java.io.FileOutputStream.open(Native Method)

at java.io.FileOutputStream.<init>(FileOutputStream.java:209)

at java.io.FileOutputStream.<init>(FileOutputStream.java:160)

at ted.TedIO.downloadTorrent(Unknown Source)

at ted.TedParser.downloadBest(Unknown Source)

at ted.TedParser.parseFeeds(Unknown Source)

at ted.TedParser.run(Unknown Source)

at ted.headless.Daemon.parseShows(Unknown Source)

at ted.headless.Daemon.runDaemon(Unknown Source)

at ted.headless.Daemon.main(Unknown Source)



/home/david/ted/ doesn't exists. No idea why he's reading from that location

In /home/david/ted096/ there is no torrent available. It should have been put in /home/dtor/autoadd/
Comment by Jofo (JoFo) - Thursday, 19 March 2009, 21:41 GMT+2
He also noted that it isn't a real daemon as the process doesn't automatically start in the background. Can this be done? Or should you use the & command in your Linux terminal to overcome this problem?
Comment by Gonçalo (gedl) - Tuesday, 24 March 2009, 08:58 GMT+2
Hi,

I'll have to take a look in the File Not Found Exception as I never got that one. However I think its Parser related and not particullary to Daemon (who in fact, just invokes the parser).

I can add some code for the Daemon to automatically detach from the console. However I'll first post a startup script for David to add to his Linux runlevel. The script invokes Ted with '&' which is the same thing as the Daemon dettaching himself from the console, plus is more flexible.

There is also an annoying bug that I'm struggling to solve: sometimes (i hate this 'sometimes' bugs) the shows configuration file is not updated after downloading a given episode (that is, the episode number does not get incremented). So, when the deamon is restarted it downloads from the previous episode number. I'll try to give a look on these 3 issues soon.
Comment by Gonçalo (gedl) - Tuesday, 24 March 2009, 10:24 GMT+2
I had a time to do some research. As i thought there is **no** portable way to run Ted as a Daemon (or any other Java program). There are some libraries that helps developers to do this, but **always** depend on something OS-specific. This is because you can't lauch another SO process, just VM threads. So, what i'll do is provide the Linux/*Nix way to run Ted as a Daemon and, in the near future (hoppefully before 0.97) the same instructions for Windows so we can cover most of our user base. For MAC I assume the same script for Linux will work (maybe you can test this later).

Regards
Comment by Jofo (JoFo) - Tuesday, 24 March 2009, 20:14 GMT+2
> I'll have to take a look in the File Not Found Exception as I never got that one. However I think its Parser related and not particullary to Daemon (who in fact, just invokes the parser).

Hmm, I'll ask David if it does work with the UI enabled. Will get back to you on this one.

> There is also an annoying bug that I'm struggling to solve: sometimes (i hate this 'sometimes' bugs) the shows configuration file is not updated after downloading a given episode (that is, the episode number does not get incremented). So, when the deamon is restarted it downloads from the previous episode number. I'll try to give a look on these 3 issues soon.

Maybe you've to call SaveShows immediately after a parsing round? It could be that it does increment the episode nr but you close the application too quickly and this increment isn't saved at that point.

> So, what i'll do is provide the Linux/*Nix way to run Ted as a Daemon and, in the near future (hoppefully before 0.97) the same instructions for Windows so we can cover most of our user base. For MAC I assume the same script for Linux will work (maybe you can test this later).

Okay, sounds fine. Roel could test the daemon on his Mac if that is ready.
Comment by Jofo (JoFo) - Thursday, 09 July 2009, 21:49 GMT+2
Moved this to v0.98 as the main developer of this feature currently isn't working at ted.
Comment by Joshua (josh) - Wednesday, 14 October 2009, 02:12 GMT+2
See comment in: FS#283 - Make plug-in support for ted

Loading...