Control-Z the Sleep Signal

Mel Flynn mel.flynn+fbsd.questions at mailing.thruhere.net
Wed Jun 10 16:07:27 UTC 2009


On Wednesday 10 June 2009 00:49:16 perryh at pluto.rain.com wrote:
> Martin McCormick <martin at dc.cis.okstate.edu> wrote:
> > 	Thanks to all. In this case, I made SIGTSTP have the
> > same effect in the program that CTRL-C does (SIGINT) so now
> > either signal makes the application remove the lock and quit
> > gracefully.
>
> To each his own, I guess.  To anyone familiar with the usual
> Unix/Linux conventions, this response to ^Z is going to be
> thoroughly unexpected.  Is there any reasonable way to do
> only the minimum cleanup need for the lock to be safely
> removed, and then suspend, reacquiring the lock when resumed?

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?
2) Why do stale locks occur to begin with?
3) Do the locks really solve the problem you thought you needed them for to 
begin with?
4) Why is it not possible to remove the locks if the PID that created them is 
not instance of said program?
-- 
Mel


More information about the freebsd-questions mailing list