This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [PATCH] Fix xend restarting problem on NetBSD

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Fix xend restarting problem on NetBSD
From: Roger Pau Monné <roger.pau@xxxxxxxxxxxxx>
Date: Mon, 18 Jul 2011 17:22:20 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 18 Jul 2011 08:25:42 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+teGHndZE+GvFlPPdpLSmncadaVy3zl6+7DHdxsGQPo=; b=e5lPtZI1DEiqFO+N8LV4+x7irs7+igpHoluGWuSniQwL7xXym6c3I+AERnhYmDKj6y q7L4NIYbbz8bQoU8uz0ZgHMcXJbNj+hlILq0F0MP0uVfhtFBi2tDhAwd8dcrdrVqkHCV jJOSjpvti5psn2WZH4QvyDPzwKjTatiPwkjDs=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20004.14192.281895.363404@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <CAPLaKK4_fWAQaiX-3Rig04zdV2VYCqQ0ZBGCp0FhZHhvCz=NCQ@xxxxxxxxxxxxxx> <20000.30270.110596.760564@xxxxxxxxxxxxxxxxxxxxxxxx> <CAPLaKK7-7o69vDaS1c6hukzuASxfE8M7SmKaQ9Jmg2ssuLzi+g@xxxxxxxxxxxxxx> <20004.14192.281895.363404@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

I'm no NetBSD expert either, it's the first time I've worked with init
scripts (and NetBSD/xen to tell the truth), so all I'm going to say
it's what I saw on other scripts or read on the Internet.

2011/7/18 Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>:
> Roger Pau Monné writes ("Re: [Xen-devel] [PATCH] Fix xend restarting problem 
> on NetBSD"):
>> While searching for a man page to show you the check_pidfile options
>> I've found that you can also set a variable with the path to the
>> interpreter, so no need to expand the script.
> Thanks.  This version is much nicer :-).  I still have a couple of
> questions.  Please forgive my ignorance about NetBSD.
>> +export PATH

This was done in start_cmd, so I through it would be better to do it
this way. I think it's necessary, because it was on the script
already, just moved the place where it was, to make the script

> Is SBINDIR not on the path for root's daemon processes ?  Perhaps we
> are doing something else wrong for NetBSD (perhaps we should be using
> libexec) ?
>> +command_interpreter=`head -n 1 ${command} | awk '{ print substr($0,3) }'`
> Why does it need to know that ?  I'm happy to believe that it does,
> but if so I would have expected to find that there was a ready-made
> utility on NetBSD that avoids having to open-code a rune like the one
> above.

Init scripts *should* detect that the daemon is a script and find it's
parser, but I don't know why NetBSD fails to detect it (haven't looked
at it to know where the problem is). Maybe there's a better or cleaner
way to do it, but I think that since xend is going to be deprecated
the fix should do for now.

>> The only strange thing is that I have to use SIGKILL to kill xend,
>> SIGTERM seems to do nothing
> That's probably a bug in the xend python code.  But I don't expect
> we'll try to fix that at this point.

No problem, SIGKILL works fine.

>> (also xend spawns two processes, but I guess this is normal).
> Yes.
>> Attached an updated patch, with a simpler script.
> Thanks.  I think my comments so far are small enough (and xend
> sufficiently deprecated) that I've applied it.  If you would like to
> further improve it in the light of my questions above please submit
> patches which will apply on top of that one.

I'm sorry that my comments my not be very informative, as I said
before I'm new to this stuff. I hope my reasons are good enough.

Thanks, Roger.

> Ian.

Xen-devel mailing list