Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jun 2009 11:28:14 -0500
From:      Martin McCormick <martin@dc.cis.okstate.edu>
To:        freebsd-questions@freebsd.org
Subject:   Re: Control-Z the Sleep Signal 
Message-ID:  <200906101628.n5AGSEOF031566@dc.cis.okstate.edu>

next in thread | raw e-mail | index | archive | help
Mel Flynn writes:
> Agreed. You're solving the wrong problem by mapping CTRL-Z to CTRL-C. The
> questions you should be asking are:
> 1) Why are stale locks bad for the app?

Because if there is one, nobody else in our group can use the
app to assign IP addresses. I made it back in 1993 so that only
one person could use it at a time because it adds and or deletes
records from the DNS and DHCP servers.
> 2) Why do stale locks occur to begin with?
> 3) Do the locks really solve the problem you thought you needed them for 

Now, there's an excellent question. They almost never do and
when they do, something very bad has happened and it needs
immediate attention. It could be that somebody put the program
to sleep because it hung as was recently the case or that it
choked so to speak which means it abnormally ended. 

> 4) Why is it not possible to remove the locks if the PID that created 
> them is
> not instance of said program?

The locks are owned by root as the program runs setuid to root
chmod 4755.

	On occasion, I find stuff I did 16 years ago and wonder,
What was I thinking?

	I will revisit the signal handler and make it output an
error message on CTRL-Z because we don't want it running if it
isn't in use.

Thanks for points well taken.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906101628.n5AGSEOF031566>