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

Re: Announce: script to automatically restart services after update of dependencies



Ben Hutchings <ben@decadent.org.uk> writes:

> On Thu, Jun 21, 2012 at 11:16:51AM +0200, Goswin von Brederlow wrote:
>> Ben Hutchings <ben@decadent.org.uk> writes:
>> 
>> > On Tue, 2012-06-19 at 15:29 +0300, Eugene V. Lyubimkin wrote:
>> >> Hello,
>> >> 
>> >> On 2012-06-19 13:59, Tomas Pospisek wrote:
>> >> > This implies that an "apt-get install library" needs to trigger that
>> >> > restart.
>> >> > Which means that apt-get needs to depend on restart-services. So either
>> >> > restart-services and checkrestart should go into the apt package, or apt
>> >> > needs
>> >> > to depend on/recommend debian-goodies, which would currently pull in
>> >> > python,
>> >> > perl, curl, dialog and their respective dependencies.
>> >> > 
>> >> > The later may be a technically working solution, but from a conceptual and
>> >> > a
>> >> > KISS point of view doesn't make sense to me.
>> >> > 
>> >> > Is my conclusion correct so far?
>> >> > 
>> >> > So if we want a "clean" solution, then checkrestart/restart-services would
>> >> > need
>> >> > to move into apt and get rid of the non-essential dependencies (get
>> >> > rewritten in
>> >> > shell or C).
>> >> 
>> >> I believe this is a wrong layer for proposed functionality -- apt-get
>> >> (libapt) is not the only high-level package manager for Debian.
>> >>
>> >> If I were you, I'd look into dpkg file triggers instead. Triggers will
>> >> by the way automatically solve the problem that you don't restart
>> >> a service 5 times if 5 libraries were upgraded.
>> >
>> > But we still need one trigger per service?  I don't think that's a good
>> > idea.
>> >
>> > Ben.
>> 
>> Do you? Why not a trigger that calls checkrestart?
>  
> I was thinking we would need a file trigger per service, which is
> activated automatically (requires changing all service packages);
> or an explicit trigger, which is activated by each library postinst
> (requires changing all library packages).
>
> Are you suggesting a file trigger on /lib and /usr/lib?  It seems
> inefficient as I think the triggered postinst would have to check
> *all* libraries, but I suppose it would work.  And presumably this is
> no worse than what checkrestart does now.
>
> Ben.

Yes, a single file trigger for /lib and /usr/lib. Unfortunately dpkg
does not tell the trigger what files have changed so indeed it would have
to check all libraries if you go that way.

If we go with an opt-in model then I would have services drop a file in
/usr/share/checkrestart/ listing the binaries (or pidfiles) that need to
be checked, look up the pid of any running instance and then check if it
has any deleted libraries in use.

This could also be part of the LSB header of init scripts or a comment
in the upstart/systemd config instead of
/usr/share/checkrestart/<service>.


Another idea would be to extend start-stop-daemon (upsstart / systemd)
to have a new option --respawn. This would do two things: 1) monitor the
child and restart a service that dies unexpectadly. 2) register the
daemon for checkrestart.  In that case start-stop-daemon would come with
an dpkg trigger to check and do the restarts.

This would be an opt-in though. Using checkrestart + blacklist would be
opt-out and would give more imediate results.

MfG
        Goswin


Reply to: