On Wednesday 07 June 2006 21:39, Steinar H. Gunderson wrote: > You never know. At any rate, I do not think it's a good thing to introduce > this kind of (perceived) "booby trap" silently in a patch.
All considered, it's a rather inoffensive trap, isn't it? > Well, an obvious improvement would be using pidof (which will not match on > a substring); from there, checking the pid file would probably be better > still. I can't say otherwise. It's probably worth considering the case where the process has been (manually) respawned and where the pid file has not been updated too. It all depends if you intend to check if the very launched process (init start) is still alive, or if you want to check that a process is running, in general. But as far as we are concerned, several nfsd processes are started, and I don't think that their pids are stored anywhere. We perhaps would also like to check if $RPCNFSDCOUNT nfsd process are still running. > Well, such a failure should never occur anyhow -- but if it does, it's a > sure sign of _something_ being wrong, and it's better to actually discover > it than to just let it silently pass, IMO. (I know this is debatable, but I > don't think I will reverse my opinion anytime soon.) I know and agree. But I just wanted to highlight the heartbeat point of view, for whom an exotic exit code is enough to kill the dog. > > If an init script, which aim is to _manage_ services, not to diagnose > > them, fails to start a service, it should IMHO exit with a return code > > indicating that it failed starting the serbice, and not with the failing > > service own exit code. > > Didn't you just say that it should exit 0? :-) Not always. It should be 3 when querying status on a stopped service. :) > Right. So if I add --oknodo to the start targets, what else is there? I suppose it would do it. To summarize LSB recommendations:: * 'start' on a stopped service should return 0 (if successfully started) * 'status' on a running service should return 0 * 'start' on a running service should return 0 * 'stop' on a running service should return 0 (if successfully stopped) * 'status' on a stopped service should return 3 * 'stop' on a stopped service should return 0 See http://linux-ha.org/LSBResourceAgent for other conditions. > (BTW, please keep the Cc: on the bug; others are reading.) Sorry about that, I didn't pay enough attention to my previous mail recipients. Regards, -- Kilian CAVALOTTI Administrateur réseaux et systèmes UPMC / CNRS - LIP6 (C870) 8, rue du Capitaine Scott Tel. : 01 44 27 88 54 75015 Paris - France Fax. : 01 44 27 70 00