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

Re: RFC: fix for daemon start on package install/upgrade out-of-runlevel



On Sun, 10 Sep 2000, Colin Watson wrote:
> hmh@rcm.org.br (Henrique M. Holschuh) wrote:
> >ISSUE: Is there a need for pre-depends?
> >
> >    A package which needs a future version of the initsciptquery interface
> >    would need to pre-depends: sysvinit (>=someversion) | filerc
> >    (>=someversion). How is this done for update-rc.d ? 
> 
> If you're using initscriptquery in your postinst (as more or less anyone
> who uses it will be?) then you only need an ordinary dependency.

If you say so. I'm not that familiar with dpkg, and I was afraid a simple
depends: would not insure the initscripquery-providing versions of sysvinit
and file-rc would have been installed AND configured before the postinst for
the packcage is called during a massive install run... so I asked about
pre-depends. :-)

> I don't know if this comes under the "administrative reasons" which you
> asked us to ignore for now :), but recently I was upgrading my work box
[...]
> With initscriptquery as it stands, I would at least have a common hook
> which I could hack to stop any of them being started; I could perhaps
> have pretended I was in runlevel 1 or something. I don't doubt you'll
> provide a cleaner solution in your "local policy" RFC, but I would
> certainly like to see the current system implemented for woody.

That would be RCS branch 1.3.0.x of the script ;-) I have two possible
solutions, and both are clean and quite safe (and they also do not change
the behaviour of the system one iota by default, so people who think they're
useless don't have a reason to oppose them. They wouldn't even be installed
in their system).

 1. Call a standard script in initscriptquery IF it is installed (if [
    -x...), and only return a exit status code of 1 (start daemon) if this
    script allows it.  This is the same way the cron and anacron packages
    deal with each other, and it's IMHO better than solution 2 below.

    I have code implementing the hook for this, but it's trivial to add
    anyway. Packages that want to implement these local policy controls,
    simply provide this script. A trivial version of the local policy script
    only needs a /etc/ config file for it to grep for <initscript ID>.

 2. Use dpkg-divert to install your own particular version of
    initscriptquery and plug the administrative stuff in there. This
    requires a sysvinit and file-rc versions of the new script. On the other
    hand, the only way to forbid this solution to be applied is by policy.
    It has zero-impact, zero traces in a system it's not installed.

So as not to bug the maintainers even more, the local admin script is not
able to differentiate installs of upgrades, BTW. This CAN be fixed, but it
would require all calls to initscriptquery to differentiate between the two,
and that would be not very nice to ask of everybody.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

Attachment: pgpQY4lVFLrKc.pgp
Description: PGP signature


Reply to: