[Discuss] How does dpkg...
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Tue Feb 18 09:05:02 PST 2014
On 2014-02-15 16:11-0800 Patrick wrote:
> ...Get an exclusive lock on /var/lib/dpkg/lock ?
>
> That backup script will wait, if it sees any package management
> type stuff going on, instead of trying to back-up the system
> *while* the system is being modified. You can see how doing
> otherwise could get ugly, yes?
>
> I'd like the script to also get an exclusive lock on the file
> when its turn comes around, in a way that dpkg will recognize
> [flock didn't work], then release said lock when finished.
Hi Patrick:
It sounds like you want to be able to mix simultaneous automatic
system updates and backups. If/when you figure out the locking
mechanism using Brendan's strace suggestion, you might be able to
implement that possibility, but I have a more fundamental question
which is why do such complete automation at all?
I agree that system updating and system backups should be mutually
exclusive activities, but can't you make sure of that by initiating
those two activities by hand (or by cron) at completely different
times rather than attempting to mix them at the same time in a
completely automated way using a locking mechanism?
Another concern is I don't think you can reliably automate system
updates in any case. Sometimes there are configuration questions that
should be answered by a human rather than always taking the default
configuration, and often (whenever there is a kernel update) there is
a system message that you should reboot ASAP after the system updates
are completed. I believe that reboot is required because the disk
updates of kernel and kernel modules do not propagate to the memory
resident in-use versions, but you could get an inconsistency between
the memory-resident old kernel and any new module that was
subsequently loaded. So it is not an emergency situation, but if you
don't do it, there is a possibility in the future that your system
will suddenly become unstable so it is a good idea to reboot when the
system delivers a message to you that you should do so. And of
course, such a reboot is not something you can automate.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
More information about the Discuss
mailing list