[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cron and package upgrade



On 2013-09-23 14:11:31 -0600, Bob Proulx wrote:
> Vincent Lefevre wrote:
> > When packages are upgraded (e.g. locales), cron scripts can given
> > errors. Is it possible to lock (delay) them during a package upgrade?
> > Shouldn't this be done by default?
> 
> I have noticed this at times too.  When I am doing a full system
> upgrade from major release to major release I manually stop cron and
> then prevent it from being restarted, then upgrade, then enable it
> again.  But cron is just one of the problems.  Any other package may
> run into the same problem.  There are an infinite number of possible
> packages that may throw an error.

During important upgrades such as locales, I avoid doing things
like starting an xterm... Usually, already running applications
are not affected (if they don't start new processes). So, I'd say
that cron is the most important problem, as it runs automatically,
and there are also cron jobs run by root, so that it is even more
annoying if they behave erratically.

> But for the routine daily upgrades I don't think disabling cron is the
> right answer.  Also would need to disable many other packages.  I
> think the better answer is to consider it a bug in the locales setup
> that it is unavailable during some parts of its upgrade.  My question
> is why are locales unavailable during an upgrade?  I haven't looked at
> what it is doing but I believe it should be possible for the locales
> postinst script to upgrade itself in place atomically such that it
> would continuously be available.

It should be done in a temporary file, with a mv at the end.

I've reported the following bug:

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=724456

suggesting 2 solutions.

> I think instead of trying to interlock with cron or other package
> that it would be more useful to look at the postinst script and see
> what it is doing and improve it there. It might be easy. It might be
> impossible. But worth a look.

Well, a race condition is still possible, but perhaps unlikely
enough to regard it as a problem.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: