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

Re: initscripts: using "/etc/init.d/<package>"



On Sun, Jul 06, 2008 at 04:38:26PM -0700, Russ Allbery wrote:
> "Eugene V. Lyubimkin" <jackyf.devel@gmail.com> writes:

> > "The package maintainer scripts must use invoke-rc.d to invoke the
> > /etc/init.d/* initscripts, instead of calling them directly."

> > Then, but, it say:

> > "Most packages will simply need to change:
> >      /etc/init.d/<package>
> >              <action>

> > in their postinst and prerm scripts to:

> >       if which invoke-rc.d >/dev/null 2>&1; then
> >       invoke-rc.d package <action>
> >       else
> >       /etc/init.d/package <action>
> >       fi
> > "
> > ... which is fallback to using /etc/init.d directly if 'invoke-rc.d' is
> > missing. But, how it can be? The package 'sysv-rc' that contains
> > 'invoke-rc.d' has 'required' priority.

> Required priority doesn't mean that you can assume the package is always
> there.  You still have to declare explicit dependencies or fall back if
> it's not unless the package is marked essential, which sysv-rc is not.

sysvinit is:

Package: sysvinit
Essential: yes
Pre-Depends: [...] sysv-rc (>= 2.86.ds1-1.2) | file-rc (>> 0.7.0), [...]

And both sysv-rc and file-rc provide invoke-rc.d.  Since sysv-rc was split
out of the sysvinit specifically to allow the alternative with file-rc, I
think it's still intended that invoke-rc.d be regarded as an Essential
interface?

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org


Reply to: