Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

nohup background process exits with logout

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> SFU / Interix - Getting Started >> nohup background process exits with logout Page: [1]
Login
Message << Older Topic   Newer Topic >>
nohup background process exits with logout - Aug. 11, '06, 9:42:35 AM   
lforster

 

Posts: 11
Joined: Dec. 12, '05,
Status: offline
In UNIX, I can run "nohup abc &" and abc will continue to run even if I log out and back in. In SFU (on W2K) it exits. I understand the process of starting background tasks in /etc/init.d with symbolic links from /etc/rc2.d (for example). But I'd rather not have to reboot the server in the test environment. Is there any other way to accomplish this? I don't want to crete a service if I can avoid it. I just want a backgroud process to persist after I log out.
Post #: 1
RE: nohup background process exits with logout - Aug. 11, '06, 12:37:17 PM   
Rodney

 

Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
You can do the [n]nohup/background thing on Interix (SFU).
What's in the script?
If there are Win32 utility calls then this might be the cause of the exiting.

(in reply to lforster)
Post #: 2
RE: nohup background process exits with logout - Aug. 11, '06, 4:19:44 PM   
lforster

 

Posts: 11
Joined: Dec. 12, '05,
Status: offline
No script, just from the kshell prompt

nohup NPU_main &

followed by exiting the shell and ending the session with the W2K server (via mstsc). When I start a new terminal session and a new kshell, and run ps -ef | grep NPU_main it's gone.

(in reply to Rodney)
Post #: 3
RE: nohup background process exits with logout - Aug. 11, '06, 4:32:51 PM   
Rodney

 

Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
What is "NPU_main" then? Does it have exit conditions?

(in reply to lforster)
Post #: 4
RE: nohup background process exits with logout - Aug. 12, '06, 4:59:13 PM   
lforster

 

Posts: 11
Joined: Dec. 12, '05,
Status: offline
NPU_main is the background process I want to continue to run when I log out. It normally runs all the time on our UNIX systems (including when I nohup it in the background). It is also normally started via a script in /etc/rc2.d - but while testing porting various programs to SFU I'd like to be able to start it in the background and stop it (via IPC) and restart it and not have to reboot the server just to keep it running if I log out.

(/dev/fs/C/Documents and Settings/lforster)
>ps -ef|grep NPU
<+lforster 22617 23447 16:43:06 n01 0:00.02 grep NPU
(/dev/fs/C/Documents and Settings/lforster)
>cd NPU/NPU_main
(/dev/fs/C/Documents and Settings/lforster/NPU/NPU_main)
>nohup NPU_main &
[1] 22681
(/dev/fs/C/Documents and Settings/lforster/NPU/NPU_main)
>sending output to nohup.out
ps -ef|grep NPU_main
<+lforster 22681 23447 16:45:28 n01 0:00.08 NPU_main
<+lforster 22809 23447 16:45:38 n01 0:00.03 grep NPU_main
(/dev/fs/C/Documents and Settings/lforster/NPU/NPU_main)
>
If I log off the W2K server and log back in, it is no longer running.

(in reply to Rodney)
Post #: 5
RE: nohup background process exits with logout - Aug. 13, '06, 4:58:55 AM   
Rodney

 

Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
It may have to do with which nohup is getting invoked.
As Interix ships there are three: one is /bin/nohup, two is
the csh/tcsh built-in and three is the sh/ksh built-in.
But, I've just tried all three and found them to be working just fine.

You wrote "mstsc": I'm assuming this is Terminal Server.
I'm thinking that it's TS specific.
Why don't you connect with telnet or ssh instead and see what happens?

(in reply to lforster)
Post #: 6
RE: nohup background process exits with logout - Aug. 13, '06, 4:38:33 PM   
lforster

 

Posts: 11
Joined: Dec. 12, '05,
Status: offline
Indeed - mstsc is short for Microsoft Terminal Server Client. I wasn't aware I could use standard telnet (from my Windows desktop/laptop) to the W2K server. Having logged in this way, I also had to navigate to my home directory (cd /dev/fs/C/"Documents and Settings"/lforster) and then run my .profile (. ./.profile) to set envionment variables. Then I navigated to the NPU_main directory and started it in the background (/bin/nohup NPU_main &) and it persists after I log out of the telnet session and back in. Thanks for the insight. It's a bit cumbersome, but far better than rebooting every time I change NPU_main in the testing phase.

(in reply to Rodney)
Post #: 7
RE: nohup background process exits with logout - Aug. 13, '06, 10:39:09 PM   
Rodney

 

Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
If you set your home directory in the user database then you will
be placed there when logging in by telnet (or ssh). The "Documents
and Settings" is a Win32 thing (which is going away in Vista -- thank god).

Anyway, see the FAQ about setting a home directory. It'll help with other
things too.

(in reply to lforster)
Post #: 8
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> SFU / Interix - Getting Started >> nohup background process exits with logout Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.031