LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-20-2010, 01:59 PM   #1
karthiksharu
LQ Newbie
 
Registered: May 2009
Posts: 15

Rep: Reputation: 0
Need alternate for nohup.


Hi all.. I am a beginner sytem admin. our developers do nohup xxx.py &. I was said that there are much better 'daemons' which are far better than nohup. Can anyone advice me how do I start researching on this or any pointer or any such daemon tool which can replace the nohup.?

Thanks in advance for any answers....
 
Old 04-20-2010, 02:07 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
There's no "better" nohup replacement that I know of. Do you mean making your python scripts daemonize themselves? http://stackoverflow.com/questions/1...cript-in-linux
 
Old 04-20-2010, 08:45 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Agree with AlucardZero. In fact, nohup isn't a daemon anyway, it prevents the associated program from terminating when the controlling terminal exits. Short for 'no-hangup'; dates back to old days when all remote access (non-console) was over phone lines eg acoustic modems.
Hanging up the phone caused logout/exit and killed any prog associated with that terminal to exit.
NB '&' only sends the program to the background, BUT it's still associated with the originating terminal.
 
Old 04-21-2010, 12:20 AM   #4
karthiksharu
LQ Newbie
 
Registered: May 2009
Posts: 15

Original Poster
Rep: Reputation: 0
the real problem i am facing is that. I am running the scripts from remote. lets say,
ssh 192.168.x.xx python startmyserver.py

startmyserver.py(which is in remote at 192.168.x.xx) contains
`nohup startoneprocess.py &`
`nohup starttwoprocess.py &`

so when I do from my machine `ssh 192.168.x.xx python startmyserver.py` the nohup.out is not created. This is because ssh being non-interactive. But the parent of the processes startoneprocess.py and starttwoprocess.py are not terminal. Its 1. So I dont have to worry about process getting killed when closing the terminal.

The solution would be `nohup starttwoprocess.py >nohup.out 2>&1 &`

Changing the scripts to redirect to nohup will not be a problem for us. But it ll be a temporary solution. Need a permanent solution. I have heard that there are daemonizing productions(opensource/may be not) available in the markets that we can use. So I get some advice on this situation.

Please correct me if I am wrong.

Thanks in advance...
 
Old 04-21-2010, 08:42 AM   #5
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
You don't need a "daemonizing production." Just make your python scripts daemonize themselves. I have linked you to one how-to in my previous post, and there are more on Google.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
nohup sycamorex Linux - General 4 01-08-2008 05:49 PM
To use or not to use nohup entz Linux - Server 9 04-07-2007 04:52 PM
problem with nohup command and nohup file size vbseeker Linux - General 1 09-17-2006 11:36 AM
Specify where nohup outputs to? chibi Linux - General 1 01-31-2006 02:15 AM
help on nohup vinayuh Linux - General 3 07-22-2005 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:04 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
Open Source Consulting | Domain Registration