LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-13-2007, 03:19 PM   #1
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Question nohup command used but process is still killed


hi there,
i'm trying to get one of my own processes to stay running in the background and only stop if i "kill" it. I run the process remotely via "ssh user@serverIP nohup /TARGET > /dev/null &" this works fine when i'm on the other server logging in and out, but when i shutdown the server i sent to command from, it also kills the running process on the remote server and i want it to stay running. Anyideas?? i can't think of anything

Thanks
mark
 
Old 02-13-2007, 04:32 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
I don't know why it's being killed with nohup, but I've used screen in that situation with no problems. Have you used screen before?
 
Old 02-13-2007, 04:36 PM   #3
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
thanks for your reply and no i've not used screen, but i think i know where the problem may lie with nohup as when ssh-ing commands to remote computer the commands outputs still to the computer your on, so i say shutdown that stops the nohup from being able to get to the /dev/null on the server i used to ssh in with, so it closes is my guess. I'm interested in screen and also however is it possible to get during a remote ssh command to output to the same server i'd be connected to and not get the outputs back at my server that could solve the problem?

Thanks Again
 
Old 02-13-2007, 04:43 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
Yes, you can use redirection with your output using screen. You can leave it outputting to stdout and when you reconnect to your screen session you can see the output, or you can output to a file and check the file afterwards.

There's a short tutorial for screen at http://www.linuks.mine.nu/irc/screen/ which explains all you need to get started with it...
 
Old 02-13-2007, 04:44 PM   #5
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
also, i'll be executing things all from bash scripts, so if i have to type stuff with this screen program then thats not what i'm after and the reason i'm trying to use the ssh command to remotly run the target file without having to login as such using an ssh terminal
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nohup command in script doesn't return to system console prompt beammeup Linux - Software 4 02-05-2007 02:01 PM
problem with nohup command and nohup file size vbseeker Linux - General 1 09-17-2006 11:36 AM
nohup process dosen't complete JeffCrew Linux - Newbie 1 10-13-2005 10:38 PM
nohup command chbin Slackware 1 03-31-2005 03:47 AM
nohup not preventing jobs from getting killed TrulyTessa Linux - Newbie 4 12-24-2004 11:39 AM


All times are GMT -5. The time now is 10:37 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration