Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Thread Closed 
Telnet jobs stop after exit
07-14-2010, 01:41 PM
Post: #1
Telnet jobs stop after exit
There may be a very straightforward answer to this question, but I can't seem to find it.
I want to open a telnet/ssh session to the PCH, start a job (e.g. copy some directories, unpack a .rar-file, etc.) and then exit the telnet, while the pch keeps fulfilling my requested job.
The problem is, once I exit the telnet, the jobs disappear. This way I have to keep my pc running just to keep the PCH doing my job.

Is there a solution for this?
Find all posts by this user
07-14-2010, 02:42 PM (This post was last modified: 07-14-2010 10:06 PM by lordy.)
Post: #2
RE: Telnet jobs stop after exit
It is because
1 the command is a child of the telnet shell.
2. the command is still linked to your telnet io streams

You can get around this in a number of ways:

1. I think the Utils have the linux 'screen' app.

2. You can also type (including brackets)...
Code:
( your_command </dev/null >/dev/null 2>&1 & )
This works most of the time.

3. If you install oversight there is a binary called daemon in the bin/nmt100/ folder.
Code:
/share/Apps/oversight/bin/nmt100/daemon your_command

( or get it from http://oversight.googlecode.com/svn/trun...100/daemon )

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
07-15-2010, 08:15 PM
Post: #3
RE: Telnet jobs stop after exit
(07-14-2010 02:42 PM)lordy Wrote:  It is because
1 the command is a child of the telnet shell.
2. the command is still linked to your telnet io streams

You can get around this in a number of ways:

1. I think the Utils have the linux 'screen' app.

2. You can also type (including brackets)...
Code:
( your_command </dev/null >/dev/null 2>&1 & )
This works most of the time.

3. If you install oversight there is a binary called daemon in the bin/nmt100/ folder.
Code:
/share/Apps/oversight/bin/nmt100/daemon your_command

( or get it from http://oversight.googlecode.com/svn/trun...100/daemon )

Thanks.
1. screen doesn't seem to be on the list for utils. Would be nice if it were. Sad
2. Since I don't have a clue what you're doing there and it's a lot of hassle to type this every time (let alone memorize it), i'll skip it Big Grin
3. works like a charm! I downloaded the seperate file and put it in the /bin with winscp+dropbear. Then chmoded it and it works as intended.
You're a lifesaver! No more comments from the wife for leaving the pc running 'for nothing' :-)
Find all posts by this user
07-15-2010, 08:38 PM
Post: #4
RE: Telnet jobs stop after exit
"nohup your_command"
should work also

PCH A-100, A-110 & A-200

Find all posts by this user
07-15-2010, 09:46 PM
Post: #5
RE: Telnet jobs stop after exit
Doh. Keep forgetting that one. - worked on too many systems where its not installed when I needed it , so I got used to
option 2 in my list Smile

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
07-16-2010, 07:37 AM
Post: #6
RE: Telnet jobs stop after exit
[noob alert :-)] is there a way to monitor what the job is doing? (a la screen)
Can you send the output that normally goes to the telnet session somewhere else where you can dynamically follow it up?
Alternatively, can you put it in a text file?

another question: I put that daemon file in /bin, which worked nicely, but upon rebooting the pch it was gone. Is there a way to put it there permanently, or put the path where it is in memory or something?
Find all posts by this user
07-16-2010, 01:20 PM (This post was last modified: 07-16-2010 01:22 PM by lordy.)
Post: #7
RE: Telnet jobs stop after exit
Try nohup as suggested by xor. as this should be built into the busybox you are using. Output goes to nohup.out (oddly no default output file on C200 busybox version)

Syntax is

Code:
nohup command &
Note with nohup you must add & at the end to run in background.

If using my daemon program output goes to /share/tmp/daemon.out

You can also use standard shell commands to send output where you want.

eg.

Code:
nohup command > log.txt 2>&1 &

daemon command > log.txt 2>&1

The last bit (2>&1) is to put errors in the same file.

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Unable to modify FTP password with telnet goutbouyo 1 1,219 11-08-2011 10:51 PM
Last Post: goutbouyo
Video Telnet OK / Play button kdavid 14 4,293 03-19-2010 02:23 AM
Last Post: rolandhii
  NMT telnet control kdavid 4 3,878 03-16-2010 02:43 PM
Last Post: kdavid
  Start samba service via telnet? gregg098 1 3,252 02-21-2010 02:28 PM
Last Post: DaTiezl
  Telnet Login & Password kr4m17 3 3,706 02-21-2010 07:55 AM
Last Post: dc11ab
  Telnet for complete Newbie [A-110] skibum 1 3,771 01-25-2010 11:54 AM
Last Post: jhmiller
  File operations and Telnet damikeh 4 2,868 01-21-2010 11:49 AM
Last Post: billgatos
  Cant stop myiHome server? Nzbget_web? lordy 2 2,317 01-04-2010 11:52 AM
Last Post: Ger Teunis
  Telnet and Syabas or User Apps without an internal drive emveepee 30 19,797 11-16-2009 11:39 AM
Last Post: dc11ab
  Bidirectional info through TELNET elite1967 1 1,258 10-08-2009 03:45 AM
Last Post: elite1967

Forum Jump: