LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   nohup command used but process is still killed (https://www.linuxquestions.org/questions/linux-newbie-8/nohup-command-used-but-process-is-still-killed-528762/)

helptonewbie 02-13-2007 03:19 PM

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

gilead 02-13-2007 04:32 PM

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?

helptonewbie 02-13-2007 04:36 PM

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

gilead 02-13-2007 04:43 PM

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...

helptonewbie 02-13-2007 04:44 PM

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


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