Unix Technical Forum

Window Exits ?

This is a discussion on Window Exits ? within the Sun Solaris Administration forums, part of the Solaris Operating System category; --> Can anyone explain the differences between the possible ways to exit a window running on Solaris 8? We were ...


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > Sun Solaris Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 10:35 AM
Mike
 
Posts: n/a
Default Window Exits ?

Can anyone explain the differences between the possible ways to exit a
window running on Solaris 8?

We were trying to test some scripts meant to run in the background and
run into some window behavior we don't quite understand.

For example when we start the script, as root, and with & -
If we close the window using the Motif window close button the
script dies.
If we close the window using Ctl-C the script dies.
If we close the window by typing exit ... the script survives.

We have seen the same behavior using a command tool window, dtterm
window, and xterm window.

What causes the different ways processes are handled when the window
is closed? Can this behavior be modified?

Any help would be gratefully appreciated.


Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 10:35 AM
Nomen Publicus
 
Posts: n/a
Default Re: Window Exits ?

Mike <msargent100@hotmail.com> wrote:
> Any help would be gratefully appreciated.


Are you using nohup ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 10:35 AM
Mike
 
Posts: n/a
Default Re: Window Exits ?

Am not using nohup but it sounds like it would work. I will give that
a try. Thanks!

However, I still the same question about window exit behavior.

What is different about using "exit" at the command-line versus using
the window menus/controls to close the window?

Because as mentioned, even without using the nohup option, the process
will continue running after logging off the workstation, if I close
the window using "exit".


Thanks



On Nov 25, 8:05 pm, Nomen Publicus <n...@buffy.sighup.org.uk> wrote:
> Mike <msargent...@hotmail.com> wrote:
> > Any help would be gratefully appreciated.

>
> Are you using nohup ?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 10:35 AM
Othmar Wigger
 
Posts: n/a
Default Re: Window Exits ?

On 25 Nov., 16:11, Mike <msargent...@hotmail.com> wrote:

> If we close the window using the Motif window close button the
> script dies.
> If we close the window using Ctl-C the script dies.
> If we close the window by typing exit ... the script survives.


The different behaviours are caused by the different signals sent by
these actions:

closing the X window sends SIGHUP (signal 1) to all its children
exiting the parent shell (with Ctrl-D or exit) sends no signal
Ctrl-C (in the foreground) sends SIGINT (signal 2)

signals can be trapped in shell scripts, e.g. executing

trap : 1

within a Bourne shell script is equivalent to starting it with nohup.
see man sh

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:22 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com