[Mono-dev] [PATCH] mono-service bugs - please review
jonpryor at vt.edu
Thu Feb 7 10:56:03 EST 2008
On Mon, 2008-02-04 at 20:32 -0500, Avery Pennarun wrote:
> On Mon, Feb 04, 2008 at 02:12:48PM -0500, Jonathan Pryor wrote:
> > On Mon, 2008-02-04 at 12:14 -0500, Avery Pennarun wrote:
> > > 1. mono-service runner doesn't catch SIGINT (it should clean up like
> > > SIGTERM, and this is especially important when using the --debug
> > > option).
> > Not as easy as you'd think; check the archives with the "Control-C
> > handler" subject. To reliably catch SIGINT/SIGTERM/etc., you'll need to
> > use UnixSignal, which was just added to svn-HEAD.
> I read that thread. Luckily or unluckily, mono-service already catches
> various signals; SIGINT should be treated identically to SIGTERM, so making
> it work "better" should be a one-liner.
> Note that it currently is implemented by polling every 500ms, which is lame
> on multiple levels (you don't want daemons waking up every 500ms on your
> laptop for no reason, as it wastes power).
The UnixSignal patch was committed to head earlier this week, and I just
migrated mono-service to use UnixSignal and UnixSignal.WaitAny() instead
of Stdlib.signal(). Consequently the polling code has been removed with
extreme prejudice, and we now have wonderful select(2)-based sleeping
care of UnixSignal.WaitAny().
This change also adds support for SIGINT, treating it identically with
With luck I'll be able to get this into 1.9 soon.
More information about the Mono-devel-list