Operating System - HP-UX
1832567 Members
5491 Online
110043 Solutions
New Discussion

Re: traps signal in /etc/profile.

 
SOLVED
Go to solution
Mark Blonde
Advisor

traps signal in /etc/profile.

Hello all,
I was wondering if I need to enter the following line in every user's .profile in order to prevent them from breaking their profile while it's being read.

trap "" 1 2 3 15


OR

if I put the line in /etc/profile, will that suffice ? I've tested this theory and it seems to work. If the line is in /etc/profile, then every script should be un-breakable...right ?

Please give me your thoughts.

Thanks
If you don't have what you want, want what you have.
4 REPLIES 4
Martin Johnson
Honored Contributor
Solution

Re: traps signal in /etc/profile.

/etc/profile is fine if you want it as a system wide default. You may want to test on a test system first to insure there are no problem with system processes.
Mark Greene_1
Honored Contributor

Re: traps signal in /etc/profile.

Also, if your system is setup to do rlogin's, be sure to test that as well.

mark
the future will be a lot like now, only later
MANOJ SRIVASTAVA
Honored Contributor

Re: traps signal in /etc/profile.

Hi Mark


Yes what you say is correct /etcprofile gets executed for all the users.


Manoj Srivastava
James R. Ferguson
Acclaimed Contributor

Re: traps signal in /etc/profile.

Hi Mark:

If you look at /etc/profile you will see that the signals are ignored (trapped) at the beginning but re-enabled at the end. You could certainly do the same in the '.profile', although I would think that you want to re-enable them there, too. Perhaps on an individual, script-by-script basis you would want to disable or otherwise handle selected signals.

Regards!

...JRF...