[OE-core] sysvinit upgrade woes

Bryan Evenson bevenson at melinkcorp.com
Thu Apr 16 21:05:29 UTC 2015


Martin and Paul,

> -----Original Message-----
> From: Martin Jansa [mailto:martin.jansa at gmail.com]
> Sent: Thursday, April 16, 2015 3:11 PM
> To: Bryan Evenson
> Cc: Paul Eggleton; openembedded-core at lists.openembedded.org
> Subject: Re: [OE-core] sysvinit upgrade woes
> 
> On Thu, Apr 16, 2015 at 06:42:58PM +0000, Bryan Evenson wrote:
> > Paul,
> >
> > > -----Original Message-----
> > > From: Paul Eggleton [mailto:paul.eggleton at linux.intel.com]
> > > Sent: Thursday, April 16, 2015 1:57 PM
> > > To: Bryan Evenson
> > > Cc: openembedded-core at lists.openembedded.org
> > > Subject: Re: [OE-core] sysvinit upgrade woes
> > >
> > > Hi Bryan,
> > >
> > > On Thursday 16 April 2015 13:53:14 Bryan Evenson wrote:
> > > > > -----Original Message-----
> > > > > From: openembedded-core-bounces at lists.openembedded.org
> > > > > [mailto:openembedded-core-bounces at lists.openembedded.org] On
> > > Behalf
> > > > > Of Bryan Evenson
> > > > > Sent: Tuesday, April 14, 2015 11:26 AM
> > > > > To: openembedded-core at lists.openembedded.org
> > > > > Subject: [OE-core] sysvinit upgrade woes
> > > > >
> > > > > I am using opkg for package management and sysvinit for init.  I am
> > > > > testing a large jump on an upgrade and I have been having a few
> issues.
> > > > > One issue I have traced to sysvinit's upgrade, but I'm unsure how to
> > > > > remedy the solution.
> > > > >
> > > > > At some point during the upgrade process, opkg records what the
> new
> > > > > version is of all the packages getting installed.  However, when I
> > > > > upgrade sysvinit causes sysvinit to restart before opkg has recorded
> > > > > which packages were just installed.  So opkg thinks that it didn't
> > > > > upgrade anything even though all packages were upgraded.  I verified
> > > > > that if I call "opkg upgrade" for all packages that require upgrade
> > > > > except for sysvinit that opkg correctly records which packages were
> > > > > upgraded.  However, the end user doesn't have that kind of control,
> > > > > so upgrading in this manner is not an option.
> > > > >
> > > > > Has anyone else seen a similar issue?  Any ideas on how to hold off
> > > > > sysvinit from restarting until after opkg has finished recording its
> > > > > information?
> > > >
> > > > I've found the problem but don't yet have a good solution.  At the end
> > > > of the sysvinit-inittab pkg_postinst script is the line:
> > > >
> > > > 	kill -HUP 1
> > > >
> > > > This kills init before opkg has finished doing its job.  On my system,
> > > > I've added a .bbappend with a pk_postinst script as follows for items
> > > > that require a reboot after installation:
> > > >
> > > >     touch /var/run/reboot-required
> > > >     echo "${PN}" >>/var/run/reboot-required.pkgs
> > > >
> > > > After my system performs firmware upgrade, it checks if
> > > > /var/run/reboot-required exists and then reboots the system.  So on
> my
> > > > system, I changed the pkg_postinst script for sysvinit-inittab to
> > > > replace the "kill -HUP 1" with the reboot required notations.
> > > >
> > > > Is there some suitable solution that would be reasonable to change in
> > > > the sysvinit-inittab recipe that would work for other people?
> > >
> > > SIGHUP is supposed to make sysvinit re-read inittab, not kill it. Can you
> tell
> > > what is actually happening?
> >
> > Ah, I don't know for sure what is happening but now I have a different
> guess.  I have tried running the upgrade with "opkg -V4 upgrade" (insanely
> verbose debug output) and I can tell that is doing the postinst scripts when
> the upgrade stops and I get logged out.  I am doing my testing through the
> debug serial port on my system.  My best guess without further proof is that
> the SIGHUP restarts my terminal which in turn kills "opkg upgrade" which was
> commanded through my terminal.
> >
> > If that is what is happening, then the upgrade should continue normally if I
> send it to the background ("opkg upgrade &"), correct?  Or it would run just
> fine if a cron job started the upgrade?
> 
> You can also run it in GNU screen session to verify this. I remember
> seeing this behavior couple years ago and I prefer screen since then
> (also for using the same screen after you set the network over serial
> cable and then want to continue in the same shell but over network).
> 

I first tried sending the upgrade to the background ("opkg upgrade &"), still logged in through my debug terminal, and it failed in the same manner.  I then tried using a cron job to do the firmware upgrade and that worked; opkg finished and correctly recorded which packages were installed.  Since its only an issue if you are issuing the upgrade from a serial terminal, I don't know if it is worth changing anything.

Thanks,
Bryan

> > > Cheers,
> > > Paul
> > >
> > > --
> > >
> > > Paul Eggleton
> > > Intel Open Source Technology Centre
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core at lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
> --
> Martin 'JaMa' Jansa     jabber: Martin.Jansa at gmail.com



More information about the Openembedded-core mailing list