Welcome
Welcome to <strong>The Linux And Unix Menagerie</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Need to run program after I logoff - Nohup is not working!!!

Any Unix Usage questions and answers

Need to run program after I logoff - Nohup is not working!!!

Postby hotmule on Wed Oct 31, 2007 3:53 pm

Howdy,

I've got a quick question. I need to run a program at work and it has to run overnight. I don't have access to the computer itself, just an ssh window.
I was told to run it as: nohup ./program
and that would keep it running even if I logged off. I don't know if I'm doing it wrong (checked manpages, etc) but it always seem to stop working after I log off and the nohup.out file is empty.

Any ideas on what might be wrong and/or how to fix it?

Thanks, again,

Mule
hotmule
 
Posts: 12
Joined: Sun Oct 28, 2007 4:49 pm

Postby laum on Wed Oct 31, 2007 6:34 pm

Hmmm....

It sounds like the shell isn't doing job control properly, but that's just speculation.

If nohup doesn't work for you, you can always try to do what it does by yourself. Basically, disassociate your process from your controlling terminal.

This can be done by backgrounding a process that you run in a subshell.

So, if you used to : ./nohup program

Try this instead: (./program &) <---- With the parentheses and ampersand

Then do: ps -ef|grep program

and you should see that it's parent process id is 1 (init). That should make sure it keeps running even when your shell exits or dies.

Hope that helps!

, laum
laum
Site Admin
 
Posts: 46
Joined: Sun Oct 14, 2007 7:04 pm


Return to Unix Usage

Who is online

Users browsing this forum: No registered users and 0 guests

cron