LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-20-2001, 03:02 PM   #1
Jimbo Mahoney
LQ Newbie
 
Registered: Aug 2001
Distribution: Mandrake 8.0
Posts: 25

Rep: Reputation: 15
Talking Got another one


OK.

At the mo, I'm putty-ing (telnet) in to the Linux box to do stuff with it.

However, I want it to run a distributed computing task (Folding@Home ver.2).

When I login as user, I can run it, but as soon as I log out, it stops the program!

I assume I will need some sort of multiple desktop type thing going on. (ALT F1? ALT F2?).

I want to be able to exclusively control the box via telnet or VNC etc. but it must run two instances of Folding@Home v.2 all day every day, whether I am telnetting in or not.

How?????

Many thanks,

Jimbo
 
Old 11-20-2001, 08:00 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Run your shell command through nohup. It causes the program to ignore the HUP (hangup) signal sent by the shell when logging out.
Code:
nohup program &
The output from the program will go to a file called nohup.out in the current directory. You can logout and 'program' will keep running.

Gary
 
Old 11-21-2001, 04:44 AM   #3
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
So, would this work with VNC?

Would it be possible for me to nohup vncserver and logout, but still allow people to view/use my comp via vnc?
 
Old 11-21-2001, 11:05 AM   #4
infernal
Member
 
Registered: Oct 2001
Location: /dev/null
Distribution: Debian, Slackware
Posts: 44

Rep: Reputation: 15
that's well done, nohup program &
you can also use the command screen , it allows
to use various virtual terminals like you said.. (alt F1, alt F2..)
heard that is cool
 
Old 11-21-2001, 02:08 PM   #5
dewcansam
Member
 
Registered: Nov 2001
Location: Hi Hat KY USA
Distribution: RedHat, Mandrake
Posts: 63

Rep: Reputation: 15
Using the '&' at the end command line causes the process to be run in the background. Even if you telnet in the process won't die when you logout.
 
Old 11-21-2001, 07:16 PM   #6
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
That's right!

I am logged in to a remote machine here, ran the ping command and put it in background...

output to a file

Last login: Tue Nov 20 21:38:26 2001
[david@Alpha david]$ ping www.redhat.com > ping.out &
[1] 2790
[david@Alpha david]$


I logged out and back in again

the ping was still going

Last login: Wed Nov 21 13:11:07 2001 from 10.0.0.2
[david@Alpha david]$ tail -f ping.out
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=99 ttl=241 time=74.295 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=100 ttl=241 time=74.760 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=101 ttl=241 time=72.273 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=102 ttl=241 time=73.324 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=103 ttl=241 time=76.790 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=104 ttl=241 time=73.791 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=105 ttl=241 time=73.862 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=106 ttl=241 time=76.313 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=107 ttl=241 time=74.728 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=108 ttl=241 time=74.297 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=109 ttl=241 time=74.359 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=110 ttl=241 time=73.991 msec
64 bytes from www.redhat.com (216.148.218.195): icmp_seq=111 ttl=241 time=74.152 msec

[david@Alpha david]$




However had I not output it to a file it would be printing to the terminal which is closed when I disconnect, background or not.

[david@Alpha david]$ ps -A |grep ping
[david@Alpha david]$

[david@Alpha david]$ ping www.redhat.com
PING www.redhat.com (216.148.218.197) from 34.45.56.678: 56(84) bytes of data.
64 bytes from 216.148.218.197: icmp_seq=0 ttl=243 time=80.726 msec
64 bytes from 216.148.218.197: icmp_seq=1 ttl=243 time=80.964 msec
64 bytes from 216.148.218.197: icmp_seq=2 ttl=243 time=78.153 msec
64 bytes from 216.148.218.197: icmp_seq=3 ttl=243 time=81.255 msec
64 bytes from 216.148.218.197: icmp_seq=4 ttl=243 time=78.535 msec
64 bytes from 216.148.218.197: icmp_seq=5 ttl=243 time=78.666 msec
64 bytes from 216.148.218.197: icmp_seq=6 ttl=243 time=78.128 msec
64 bytes from 216.148.218.197: icmp_seq=7 ttl=243 time=77.931 msec
64 bytes from 216.

Last login: Wed Nov 21 13:20:18 2001 from 10.0.0.2
[david@Alpha david]$ ps -A |grep ping
[david@Alpha david]$

[david@Alpha david]$ ping www.redhat.com &
[1] 3164
[david@Alpha david]$ PING www.redhat.com (216.148.218.197) from 34.45.56.678: 5
6(84) bytes of data.
64 bytes from 216.148.218.197: icmp_seq=0 ttl=243 time=79.805 msec
64 bytes from 216.148.218.197: icmp_seq=1 ttl=243 time=79.587 msec
64 bytes from 216.148.218.197: icmp_seq=2 ttl=243 time=78.302 msec
64 bytes from 216.148.218.197: icmp_seq=3 ttl=243 time=78.789 msec
64 bytes from 216.148.218.197: icmp_seq=4 ttl=243 time=81.991 msec
64 by

Last login: Wed Nov 21 13:23:20 2001 from 10.0.0.2
[david@Alpha david]$ ps -A |grep ping
[david@Alpha david]$


sending it to a file without the bg command (&) will not let it live either..

If I disconnect it dies.

[david@Alpha david]$ ping www.redhat.com > ping.out



Last edited by DavidPhillips; 11-21-2001 at 07:33 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration