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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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 ? |
| ||||
| 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 |