![](https://seccdn.libravatar.org/avatar/669cea0d3fd2d12370cec955b95c0cec.jpg?s=120&d=mm&r=g)
Hi- Think back to your shell programming days.... Ahh, the good times :) Ok, I'm trying to send a particular signal to a running process. I'm assuming that I use SIGUSR1 and SIGUSR2. How do I go about configuring what those are signal values are in my shell script (bash in particular)? I don't need to do this in perl nor in C, but bash. I've dug on the net, but haven't been too successful, that and I don't have my UNIX Power Tools book with me right now. thanks, brian -- Brian Jackson Photo Sports ~ Editorial ~ People ~ Travel ~ Events http://www.BrianJacksonPhoto.com 650-218-5082
![](https://seccdn.libravatar.org/avatar/b12cfb65ca4faebc3e3aac17838e8f8d.jpg?s=120&d=mm&r=g)
Brian, On Tuesday 05 October 2004 10:50, Brian Jackson wrote:
Hi-
Think back to your shell programming days.... Ahh, the good times :)
Back?
Ok, I'm trying to send a particular signal to a running process. I'm assuming that I use SIGUSR1 and SIGUSR2.
How do I go about configuring what those are signal values are in my shell script (bash in particular)?
Try this: % help kill kill: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec] Send the processes named by PID (or JOB) the signal SIGSPEC. If SIGSPEC is not present, then SIGTERM is assumed. An argument of `-l' lists the signal names; if arguments follow `-l' they are assumed to be signal numbers for which names should be listed. Kill is a shell builtin for two reasons: it allows job IDs to be used instead of process IDs, and, if you have reached the limit on processes that you can create, you don't have to start a process to kill another one. This will tell you that you can use symbolic signal names or tell you that you can use: % 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 35) SIGRTMIN .. 64) SIGRTMAX
I don't need to do this in perl nor in C, but bash. I've dug on the net, but haven't been too successful, that and I don't have my UNIX Power Tools book with me right now.
Naturally, "man bash" would tell you this, as well.
thanks, brian -- Brian Jackson Photo
Randall Schulz -- Making BASH jump through hoops since 1997.
![](https://seccdn.libravatar.org/avatar/669cea0d3fd2d12370cec955b95c0cec.jpg?s=120&d=mm&r=g)
On Tuesday 05 October 2004 11:13, Randall R Schulz wrote:
Try this:
% help kill kill: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec] Send the processes named by PID (or JOB) the signal SIGSPEC. If SIGSPEC is not present, then SIGTERM is assumed. An argument of `-l' lists the signal names; if arguments follow `-l' they are assumed to be signal numbers for which names should be listed. Kill is a shell builtin for two reasons: it allows job IDs to be used instead of process IDs, and, if you have reached the limit on processes that you can create, you don't have to start a process to kill another one.
Oh, I did all of that. I went through 12 pages of Google search results as well. I know how to send a different signal to a process. I wanted to know how to specify what the value of the signal was. I wanted to set SIGUSR1 to 100 and SIGUSR2 to 101, but ended up modifying the process to look for SIGUSR1 and SIGUSR2 and take the appropriate action. thanks, brian -- Brian Jackson Photo Sports ~ Editorial ~ People ~ Travel ~ Events http://www.BrianJacksonPhoto.com 650-218-5082
![](https://seccdn.libravatar.org/avatar/b12cfb65ca4faebc3e3aac17838e8f8d.jpg?s=120&d=mm&r=g)
Brian, On Tuesday 05 October 2004 11:32, Brian Jackson wrote:
On Tuesday 05 October 2004 11:13, Randall R Schulz wrote:
Try this:
% help kill ...
Oh, I did all of that. I went through 12 pages of Google search results as well.
I know how to send a different signal to a process.
I wanted to know how to specify what the value of the signal was. I wanted to set SIGUSR1 to 100 and SIGUSR2 to 101, but ended up modifying the process to look for SIGUSR1 and SIGUSR2 and take the appropriate action.
That's not up to you. (Also, I'm not sure why you'd care what number was associated with a given signal name.) Signals are a kernel thing, and while all of them can be sent from one process to another, most of them are primarily generated by the kernel itself. Given that there are different default dispositions, consequences and side-effects of sending different signals, the kernel must assign the numberic value associated with each conceptual signal.
thanks, brian -- Brian Jackson Photo
Randall Schulz
![](https://seccdn.libravatar.org/avatar/669cea0d3fd2d12370cec955b95c0cec.jpg?s=120&d=mm&r=g)
On Tuesday 05 October 2004 11:41, Randall R Schulz wrote:
I wanted to know how to specify what the value of the signal was. I wanted to set SIGUSR1 to 100 and SIGUSR2 to 101, but ended up modifying the process to look for SIGUSR1 and SIGUSR2 and take the appropriate action.
That's not up to you. (Also, I'm not sure why you'd care what number was associated with a given signal name.) Signals are a kernel thing, and while all of them can be sent from one process to another, most of them are primarily generated by the kernel itself. Given that there are different default dispositions, consequences and side-effects of sending different signals, the kernel must assign the numberic value associated with each conceptual signal.
And that's what eventually hit me. I don't deal with signals too often. Like I said in an earlier post: brain fart. I just sent the SIGUSR1 to the other app and traped it's signal to do what we wanted to do. thanks, brian -- Brian Jackson Photo Sports ~ Editorial ~ People ~ Travel ~ Events http://www.BrianJacksonPhoto.com 650-218-5082
![](https://seccdn.libravatar.org/avatar/e0f9409f9a84daad85e8b5e766cf2567.jpg?s=120&d=mm&r=g)
Brian Jackson writes:
Ok, I'm trying to send a particular signal to a running process. I'm assuming that I use SIGUSR1 and SIGUSR2.
How do I go about configuring what those are signal values are in my shell script (bash in particular)?
man kill -Ti
![](https://seccdn.libravatar.org/avatar/669cea0d3fd2d12370cec955b95c0cec.jpg?s=120&d=mm&r=g)
On Tuesday 05 October 2004 10:50, Brian Jackson wrote:
Hi-
Think back to your shell programming days.... Ahh, the good times :)
Ok, I'm trying to send a particular signal to a running process. I'm assuming that I use SIGUSR1 and SIGUSR2.
Ok, thanks to those that replied to me. We've figured out what to do. I'm traping the SIGUSR1 and SIGUSR2 in the app that we're sending the signal to. brain fart there on the app logic flow :-D brian- -- Brian Jackson Photo Sports ~ Editorial ~ People ~ Travel ~ Events http://www.BrianJacksonPhoto.com 650-218-5082
![](https://seccdn.libravatar.org/avatar/24ca8608248a11f8eeb5fa02a0d5c463.jpg?s=120&d=mm&r=g)
Brian wrote regarding '[SLE] basic shell signal question' on Tue, Oct 05 at 12:51:
Think back to your shell programming days.... Ahh, the good times :)
Ahh, yesterday afternoon. Those were the days... :) --Danny, waiting for the sh-gtk bindings
participants (4)
-
Brian Jackson
-
Danny Sauer
-
Randall R Schulz
-
ti@amb.org