Roger Pau Monné
2011-Jul-15 08:34 UTC
[Xen-devel] [PATCH] Fix xend restarting problem on NetBSD
Hello, This patch fixes a problem with xend restart on NetBSD (the rc.d script was unable to find the pid of the process, so it was not restarted). Regards, Roger. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Jul-15 17:17 UTC
Re: [Xen-devel] [PATCH] Fix xend restarting problem on NetBSD
Roger Pau Monné writes ("[Xen-devel] [PATCH] Fix xend restarting problem on NetBSD"):> This patch fixes a problem with xend restart on NetBSDHi. Thanks for the patch. But I think this patch does more than you say it does ? It introduces a new xen_startcmd, xen_stop and xen_status. Presumably these were previously provided by standard NetBSD machinery ? Why is that standard machinery unsuitable for start and status ?> (the rc.d script was unable to find the pid of the process, so it > was not restarted).Why wasn''t the standard NetBSD machinery able to find the pid ? How does its approach differ from check_pidfile ? Sorry if these are all stupid questions. If you can refer me to some documentation about the NetBSD init system I may be able to pretend to be less ignorant :-). Thanks, Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Roger Pau Monné
2011-Jul-15 18:49 UTC
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. The only strange thing is that I have to use SIGKILL to kill xend, SIGTERM seems to do nothing (also xend spawns two processes, but I guess this is normal). Attached an updated patch, with a simpler script. Thanks for making me look at it again, Roger. 2011/7/15 Ian Jackson <Ian.Jackson@eu.citrix.com>:> Roger Pau Monné writes ("[Xen-devel] [PATCH] Fix xend restarting problem on NetBSD"): >> This patch fixes a problem with xend restart on NetBSD > > Hi. Thanks for the patch. But I think this patch does more than you > say it does ? > > It introduces a new xen_startcmd, xen_stop and xen_status. Presumably > these were previously provided by standard NetBSD machinery ? Why is > that standard machinery unsuitable for start and status ? > >> (the rc.d script was unable to find the pid of the process, so it >> was not restarted). > > Why wasn''t the standard NetBSD machinery able to find the pid ? > How does its approach differ from check_pidfile ? > > Sorry if these are all stupid questions. If you can refer me to some > documentation about the NetBSD init system I may be able to pretend to > be less ignorant :-). > > Thanks, > Ian. >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Jul-18 13:38 UTC
Re: [Xen-devel] [PATCH] Fix xend restarting problem on NetBSD
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.> +PATH="${PATH}:${SBINDIR}" > +export PATHIs 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.> The only strange thing is that I have to use SIGKILL to kill xend, > SIGTERM seems to do nothingThat''s probably a bug in the xend python code. But I don''t expect we''ll try to fix that at this point.> (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. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Roger Pau Monné
2011-Jul-18 15:22 UTC
Re: [Xen-devel] [PATCH] Fix xend restarting problem on NetBSD
Hello, 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@eu.citrix.com>:> 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. > >> +PATH="${PATH}:${SBINDIR}" >> +export PATHThis 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 cleaner.> > 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 Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Jul-18 16:12 UTC
Re: [Xen-devel] [PATCH] Fix xend restarting problem on NetBSD
Roger Pau Monné writes ("Re: [Xen-devel] [PATCH] Fix xend restarting problem on NetBSD"):> 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.OK, that''ll do :-). Thanks for your contribution. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel