[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Signal names
From: |
Tim Auckland |
Subject: |
Signal names |
Date: |
Tue, 16 Apr 2002 21:18:21 -0700 |
cfengine appears to have a hardwired mapping between signal names and
signal numbers, given by tables in globals.c and cf.defs.h. This fails
for all but the most common signals.
For example, I tried to use the following on RedHat 7.2 to signal xinetd
to reread it's config files:
processes:
"xinetd" signal=USR2
cfengine claims to have done the right thing, but it actually sent
SIGUNUSED:
# strace -e trace=kill -e signal=\!all /var/cfengine/bin/cfagent -q
cf:rdmrh72: Signalling process 923 (xinetd) with SIGUSR2
kill(923, SIGUNUSED) = 0
In order to get a real USR2 on linux, I have to lie, and use:
processes:
"xinetd" signal=SYS
# strace -e trace=kill -e signal=\!all /var/cfengine/bin/cfagent -q
cf:rdmrh72: Signalling process 923 (xinetd) with SIGSYS
kill(923, SIGUSR2) = 0
I'm not sure where the hardcoded lists in cfengine come from, but they
don't match reality on any of the platforms I use:
Linux:
# kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE
9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2
13) SIGPIPE 14) SIGALRM 15) SIGTERM 17) SIGCHLD
18) SIGCONT 19) SIGSTOP 20) SIGTSTP 21) SIGTTIN
22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ
26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO
30) SIGPWR 31) SIGSYS 32) SIGRTMIN 33) SIGRTMIN+1
34) SIGRTMIN+2 35) SIGRTMIN+3 36) SIGRTMIN+4 37) SIGRTMIN+5
38) SIGRTMIN+6 39) SIGRTMIN+7 40) SIGRTMIN+8 41) SIGRTMIN+9
42) SIGRTMIN+10 43) SIGRTMIN+11 44) SIGRTMIN+12 45) SIGRTMIN+13
46) SIGRTMIN+14 47) SIGRTMIN+15 48) SIGRTMAX-15 49) SIGRTMAX-14
50) SIGRTMAX-13 51) SIGRTMAX-12 52) SIGRTMAX-11 53) SIGRTMAX-10
54) SIGRTMAX-9 55) SIGRTMAX-8 56) SIGRTMAX-7 57) SIGRTMAX-6
58) SIGRTMAX-5 59) SIGRTMAX-4 60) SIGRTMAX-3 61) SIGRTMAX-2
62) SIGRTMAX-1 63) SIGRTMAX
Solaris:
# kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGEMT 8) SIGFPE
9) SIGKILL 10) SIGBUS 11) SIGSEGV 12) SIGSYS
13) SIGPIPE 14) SIGALRM 15) SIGTERM 16) SIGUSR1
17) SIGUSR2 18) SIGCHLD 19) SIGPWR 20) SIGWINCH
21) SIGURG 22) SIGIO 23) SIGSTOP 24) SIGTSTP
25) SIGCONT 26) SIGTTIN 27) SIGTTOU 28) SIGVTALRM
29) SIGPROF 30) SIGXCPU 31) SIGXFSZ 32) SIGWAITING
33) SIGLWP 34) SIGFREEZE 35) SIGTHAW 36) SIGCANCEL
37) SIGLOST
HP-UX:
# kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGEMT 8) SIGFPE
9) SIGKILL 10) SIGBUS 11) SIGSEGV 12) SIGSYS
13) SIGPIPE 14) SIGALRM 15) SIGTERM 16) SIGUSR1
17) SIGUSR2 18) SIGCHLD 19) SIGPWR 20) SIGVTALRM
21) SIGPROF 22) SIGIO 23) SIGWINCH 24) SIGSTOP
25) SIGTSTP 26) SIGCONT 27) SIGTTIN 28) SIGTTOU
29) SIGURG 30) SIGLOST 32) SIGDIL 33) SIGXCPU
34) SIGXFSZ 35) SIGCANCEL
You might want to take a look at how the bash shell handles the same
problem. It first builds and runs a mksignames.c to generate a
signames.h, which is then included in the main compilation.
Tim
- Signal names,
Tim Auckland <=
- Re: Signal names, Mark . Burgess, 2002/04/22
- Re: Signal names, Michael Beattie, 2002/04/22
- Re: Signal names, Tim Auckland, 2002/04/22
- Re: Signal names, Michael Beattie, 2002/04/22
- Re: Signal names, Tim Auckland, 2002/04/22
- Re: Signal names, Michael Beattie, 2002/04/22
- Re: Signal names, Mark . Burgess, 2002/04/23
- Re: Signal names, Mark . Burgess, 2002/04/23
- Re: Signal names, Michael Beattie, 2002/04/23
- Signal names with autoconf?, Mark . Burgess, 2002/04/23