Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

starting a process

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Is there a way to start a process and to run it even when the pseudo terminal (remote- terminal) is closed.

Pl help !!. Thanks in advance.

 
The popular method is 'nohup', however I often use 'at', like so:

print "ls /usr/bin/ksh" | at now

Because it is easy to set it to go off later when used in a script.

There is also a freeware prog called "screen", but I have little experience with it. It does allow you to start up processes, detach the pty, then reattach it later at a different location. Same shell, keeps your history and everything.

 
Thanks to both of you. I used nohup and |at now.

I still get my process killed when I close the remote terminal.

Any advice ?

Thanks.
 
Hum, well I'm not sure what is going on. Whe you use "at" to run the job, it should not be associated with your terminal at all. I do it all the time. How are you connecting, telnet I assume?

My experience:
o14777@unixweb:/utc/home/o14777>print "sleep 60"|at now
Job o14777.1020282699.a will be run at Wed May 1 15:51:39 EDT 2002.
o14777@unixweb:/utc/home/o14777>ps -ef|grep leep
o14777 8922 7732 0 15:51:39 - 0:00 sleep 60
o14777@unixweb:/utc/home/o14777>
Connection closed.
o14777@xp0:/utc/home/o14777>rsh unixweb
o14777's Password:
o14777@unixweb:/utc/home/o14777>ps -ef|grep leep
o14777 8934 7752 0 15:52:59 - 0:00 sleep 60

OK, I know... the PID is different because I took too long to ^D and rsh back, however I did test it and the sleep remained. My cut-n-paste was not fast enough, though. =)

How are you exiting your shell?
 
Ah that was odd... if that is unreadable let me know and I'll repost.
 

That was a telnet session.

I use exit to quit, then I am prompted with

"There are stopped jobs"

To quit I have to type exit again.

When I log back I see nothing of my process.
 
I am not able to repeat your issue. I am using ksh. My $TERM is xterm.

o14777@unixweb:/utc/home/o14777>print "sleep 60"|at now
Job o14777.1020285221.a will be run at Wed May 1 16:33:41 EDT 2002.
o14777@unixweb:/utc/home/o14777>ps -ef|grep sleep
o14777 7690 55888 0 16:33:41 - 0:00 sleep 60
o14777 40006 49652 1 16:33:47 pts/2 0:00 grep sleep
o14777@unixweb:/utc/home/o14777>exit
Connection closed.

I do not get the "stopped jobs" message. Note column six of the sleep process has a dash, unlike my grep which has my terminal. Seems like you are sending a stop signal somehow.... You are getting that message because, well, the job is attached to your terminal. Post some clippings of what you are doing, maybe someone can spot it.
 
Thank you for all your help. Really appreciate it.

My term is not properly set. |at now is working for me now.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top