signals to running processes

James Logan III logan at vsedev.VSE.COM
Fri Dec 2 13:54:15 AEST 1988


In article <1267 at vsedev.VSE.COM> hudson at vsedev.VSE.COM (C Hudson Hendren III) writes:
# 
# It would only need to call msgrcv() in the signal handler for SIGUSR1.
#

Shared memory could also read the char array the same way on
receipt of SIGUSR1 (it could do it *faster* even!), but I don't
see any good way of sending a signal to the daemon.  

How is another user going to find the PID of the daemon?  Does
the user run 'ps -ef | grep "some_name"' and give it to this
other program as an argument?  Do you hack on the "ps" source
to look through the process table for some_name?

Even if the daemon wrote its PID into some file, what do you
think happens when *two* daemons are running?  If the daemon
writes the PID in append mode, how are do you know which PID is
the one you're interested in?  

# Another advantage of this method is that there is no need to use semaphore
# locking.

That code is trivial and is not necessary on the daemon side.

			-Jim

-- 
Jim Logan		logan at vsedev.vse.com
(703) 892-0002		uucp:	..!uunet!vsedev!logan
			inet:	logan%vsedev.vse.com at uunet.uu.net



More information about the Comp.unix.questions mailing list