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

Bug#76868: invoke-rc.d proposal)



On Tue, Nov 14, 2000 at 12:06:36PM -0200, Henrique M Holschuh wrote:
> > I'm also (duh) against falling back to a new, optional argument without
> > any indication that's appropriate when called. I think that's a really bad
> > design. But I'm not really sure what more I can say to convince you this
> > is a bad idea. :-/
> I thought you hated the idea of error messages (by the end of that past
> thread on the issue, at least)? well, here's what the current invoke-rc.d
> would output:

You shouldn't hide error messages. Nor should you receive them in
normal usage.

If you hide error messages, you'll make it harder for people to notice
bugs in their init scripts when they upload a new package (let's see,
yup, seems to work fine in my postinst, no errors, great!). And receiving
them in normal usage is just messy.

> (in a fallback request)
> godzillah:/tmp/sysvinit$ ash ./invoke-rc.d nfs-kernel-server restart
> invoke-rc.d: "restart" of nfs-kernel-server attempted out of runlevel.
> invoke-rc.d: using fallback "restart-if-running" instead of "restart".
> Usage: nfs-kernel-server {start|stop|reload|force-reload|restart}
> invoke-rc.d: initscript nfs-kernel-server, action "restart-if-running" failed.

Errr. Shouldn't the invoke-rc.d: stuff only appear with some sort of
--verbose argument?

> You can convince me that the 'restart-if-running' fallback is a bad idea if
> you give me a concrete example where things will break because of the
> restart-if-running fallback,

	restart-if-running)
		# muahahahahah
		rm -rf /
		;;

It's an unrealistic example, obviously, but I suspect it's still policy
compliant at the moment. I just don't think invoke-rc.d should be doing
something you don't specifically ask for behind your back. For scripts
that *do* support restart-if-running, you can just explicitly ask for it.

> OR if you give me another solution that is workable.

Don't do fallbacks. For scripts that don't support r-i-r, use:

	invoke-rc.d foo restart

for scripts that do support r-i-r, use:

	invoke-rc.d foo restart-if-running

. Don't dipslay the "invoke-rc.d:" stuff unless --verbose is specified,
don't hide any errors from the init.d scripts ever.

> Also, do remember that the fallback will only happen in a system
> where the local administrator knows enough about runlevels to change
> Debian's default of 'start service in all runlevels'.

It'll also happen if the admin changes to single user mode, and then
installs some packages.

Cheers,
aj

-- 
Anthony Towns <aj@humbug.org.au> <http://azure.humbug.org.au/~aj/>
I don't speak for anyone save myself. GPG signed mail preferred.

  ``We reject: kings, presidents, and voting.
                 We believe in: rough consensus and working code.''
                                      -- Dave Clark

Attachment: pgpm0Z8S8jZaG.pgp
Description: PGP signature


Reply to: