| This does not seem to make a difference. rd is started from .xinitrc which ge
ts run
| from inittab for the runlevel we use. I use killall rd in the killdisplay scr
ipt which
| sends, I believe a signal 15 (SIGTERM) to rd.
I'd expect it to. However, might I suggest you make your script write
its pid to a file and just grab the pid from there instead of using
killall. You may not have been reading the thread on grepping ps
listings where some of us were trying to encourage people to avoid
tools like killall and instead use accurate methods.
| At this point something sends a signal 1
| (SIGHUP?)
Signal 1 is SIGHUP, yes.
[...]
| I do have a question though. Is there a way to test for the signal sent to sc
ript
| under various circumstances with out trapping each one individually and sendin
g an echo
| or something? I was thinking about some thing like:
|
| trap 'echo SOME_SIGNAL_VARIABLE' 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
Sure. You can say:
trap 'echo OUCH' 1 2 3 4 .......
however there's no way to find out which signal you received. The only
way to know is to trap each individually. Of course, you can go:
for sig in 1 2 3 4 5 .....
do trap "signum=$sig; echo OUCH from \$signum" $sig
done
or
for sig in 1 2 3 4 5 .....
do trap "my_sig_func $sig" $sig
done
and write yourself a my_sig_func() function.
| or something like that. I need to go ahead and trap the signal 15 incase some
one sends
| a kill but other than that I really don't know what is likely to occur in real
l life.
Might I suggest you trap _only_ the normal termination signals: 1
(hangup), 2 (interrupt, aka ^c) and 15 (termination). These are sent at
end of session (ancestry is modem hangup), keyboard interrupt to an
interactive command, and external termination (kill and killall's
defunct signal) respectively.
All the other signals are exception conditions and generally you do NOT
want to catch them. They all have sensible default actions.
Even the normal signals need not be trapped unless you have tidyup to do
(removal of working files, killing of children etc).
--
Cameron Simpson, DoD#743 [EMAIL PROTECTED] http://www.zip.com.au/~cs/
We should grant power over our affairs only to those who are reluctant to
hold it and then only under conditions that increase the reluctance.
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list