Using trap command (was: Exceeded User Count)
Bill Akers
billa at mgmindustries.com
Fri Feb 11 06:34:14 PST 2005
Lerebours, Jose wrote:
>>[...]
>>
>>>>Some systems don't seem to send or receive the proper
>>
>>socket shutdown
>>
>>>>commands when you exit with the "x" to close the window.
>>
>>This causes
>>
>>>>the *nix box to keep the session open, and as such the
>>
>>filePro program
>>
>>>>is still running.
>>>
>>>I had a couple of users telnetting into SCO Unix who had in their
>>>.profile "trap '' 1 2 3", a holdover from long past dumb terminal
>>>days. These users could not click 'x' on the windows
>>
>>window? to close
>>
>>>it without leaving open processes and idleout would also leave open
>>>processes. Commenting the trap command out solved the problem.
>>
>>Telling the shell to ignore SIGHUP explicitly says "I don't want to
>>kill any process if the user disconnects".
>>
>
>
> This is revealing to me ... and possibly the answer to all those
> "<defunct>" processes I've seen in a couple of places.
>
> I normally use `trap` as well to keep user within a shell script
> where a qualifier is chosen and filePro application is opened with
> chosen qualifier.
>
> Removing the `trap` command causes the script to close if user
> exits filePro pressing DEL key.
>
> Am I caught in a loose/loose situation or is there a remedy?
You can use trap in judicious ways; it does not have to be trap '' 1 2
3. it can be trap '' 2 or trap '' 3, as examples, inside shell
scripts. I just could not think of a good reason to trap any interrupt
in the user's .profile since that is at the exit or entry level
anyway. I have used trap inside user executable shell scripts in many
places to prevent the filepro 'delete' key from causing unwanted ugly
exiting, but that particular trap is deactivated when that shell
script is exited.
>
> Regards;
>
>
> Jose Lerebours
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
> .
>
More information about the Filepro-list
mailing list