signals to running processes
Jonathan Sweedler
cjosta at taux01.UUCP
Wed Nov 30 17:01:28 AEST 1988
I have a program that takes a long time to finish running. From time
to time (sometimes never, sometimes more frequently) I would like to
find out the current status. The way I accomplish this is to send one
of the user defined signals (SIGUSR1 - no. 30) to the process. The
process has a signal handler that catches this signal and writes out
the current state (number of loops done, how long it has been running,
when it will finish, etc.). This all works fine but only I (the owner
of the process) can send the signal. If my boss, for example, wants to
look at the status of the process, he can't.
My questions are these:
1) Is there any way for someone who is not the owner of a process to
send the process a signal?
2) Or, is there another way for a random user to cause a program to
asynchronously print out a status report (or perform some action) once
it has started running?
I know I can have the program print out a status report every
x minutes/hours/loops/whatever, but I don't want this. I want the
report to be printed out only when specified to do so.
I could also probably (haven't done this yet) write a shell script that
would send the signal and is setuid to me but then if different people
run the program (other than me), there must be different shell scripts
that are setuid to each person who might run the program. For example,
if either user A or user B might run the program, but it is user C that
wants the progress report, then there must be a shell script setuid'ed
to A and one setuid'ed to B. Is there a cleaner approach?
--
Jonathan Sweedler === National Semiconductor Israel
UUCP: ...!{amdahl,hplabs,decwrl}!nsc!taux01!cjosta
Domain: cjosta at taux01.nsc.com
More information about the Comp.unix.questions
mailing list