[Pkg-xen-devel] Bug#681343: xcp-xapi: wait_for_xapi() function in init.d script does not work

Ian Campbell ijc at hellion.org.uk
Fri Jul 13 15:05:13 UTC 2012


On Fri, 2012-07-13 at 09:08 +0100, Mike McClurg wrote:
> On Thu, Jul 12, 2012 at 7:40 PM, Ian Campbell <ijc at hellion.org.uk> wrote:
> > On Thu, 2012-07-12 at 12:10 -0600, Thomas Goirand wrote:
> >> On Thu Jul 12 2012 11:38:58 AM CST, Bastian Blank <waldi at debian.org> wrote:
> >> > On Thu, Jul 12, 2012 at 05:35:08PM +0400, George Shuklin wrote:
> >> > > +                             # Check whether the md5 of the create-templates binary
> >> > > matches the one +                             # used previously. If not, recreate
> >> > > the templates. +                             if [ -e
> >> > > /usr/lib/xcp/lib/create_templates ]; then +                                             if !
> >> > > md5sum -c --status $TEMPLATES_MD5_STAMP ; then
> >> > > /usr/lib/xcp/lib/regenerate-templates start +
> >> > >           md5sum /usr/lib/xcp/lib/create_templates > $TEMPLATES_MD5_STAMP
> >> >
> >> > Whas is this and why is it in the init script instead of the postinst
> >> > script?
> >> >
> >> > Bastian
> >>
> >> hi,
> >>
> >> this creates the templates so that later you can
> >> use:
> >> xe template-list name-label=Debian\ Squeeze [...]
> >> then use this template UUID when doing:
> >> xe vm-create
> >>
> >> if this isn't done, then xe template-list is empty.
> >>
> >> When you install xcp-xapi with apt-get, xapi is not
> >> running, so it can't be done in the postinst. We
> >> have to wait until the administrator configures
> >> TOOLSTACK=xapi and reboots. Which is why doing it in
> >> the init script makes sense.
> >
> > It may (or may not) also make sense to do this in the postinst iff xapi
> > is actually running? This way users will immediately get new templates
> > on upgrade without requiring manual steps or a reboot.
> 
> The user would have to restart the xcp-xapi service after an upgrade,
> and therefore this init script would be run again. So I think that
> adding the template creation logic to the postinst script would be
> redundant.

Actually, the postinst should normally do the restart I think but
otherwise you are correct.

Ian.

> 
> Otherwise, I think George's patch looks fine.
> 
> Mike
> 





More information about the Pkg-xen-devel mailing list