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

Re: dpkg-reconfigure and init scripts



On Mon, 30 Sep 2002, Jonas Meurer wrote:
> On 29/09/2002 Joey Hess wrote:
> > No, there is no good way for a postinst script to tell if it is being
> > run as reconfiguration. I don't really want to promote the hack that
> > lets postinst scripts detect that.
> 
> Mh, I think dpkg-reconfigure should be patched, not dh_installinit.
> dpkg-reconfigure could check (with pidof) if the daemon is running, if
> not start, and if it runs, restart. That would be the simplest solution.

No way.  Think about what you just wrote, will you?  Have you even READ the
whole bunch of init scripts at all (and I just mean the ones in Standard and
Required packages)?

And for God's sake, init scripts deal with SERVICES, not daemons!  NEVER
violate the interface to the services, you will just screw up things even
worse.

Just fix the _code_ generated by dh_installinit to:

invoke-rc.d restart

This will work regardless of the *service* being already started or not.  It
will automagically NOT start the service out-of-runlevel.

-- 
  "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



Reply to: