Gerrit Pape wrote on 31/07/2005 21:20: > A good dependency concept not only finds out the right order to startup > services, but also to shut them down. A real good dependency system > takes service dependencies also into account when a single service is > taken down (think removing packages) or terminates unintentionally while > system uptime.
Sorry, but your runit concept doesn't seem to handle dependencies at all, at least not during startup. It might make sure all dependency runscripts are (trying to) start, but it doesn't handle the dependency in an intelligent way (i.e. only starting X when it's dependency on Y is actually fulfilled, not only trying to be fulfilled). > Regarding your question above, this would be handled automatically by > runit, as it will restart the "hold" service if it fails, until it > succeeds eventually. If you don't think that's a "clean" solution, or > the startup of this specific service takes a lot of resources, add a > check for the dependency to the top of the run script (before execing > into the daemon), and either wait, or simply exit to be restarted. Sorry, but this is exactly what I expect from a dependency based init system: Only start a service, when the dependencies _are_ fulfilled. And to only stop a service which is depended upon when all those services which depend on it are already stopped. I expect that a service lets the init system know when it is started succesfully. > This also works with cross-machine dependencies, btw. Yeah, of course. > System startup is just a minor part of init's duties in my opinion. You mix a daemon babysitter process with the init system in my opinion. A babysitter process has to start or stop the daemon when asked to do so (and doesn't need to know about dependencies), the init system has to handle dependencies and start/stop daemons or ask the babysitter process to start/stop them. In my opinion, it makes no sense to mix these two things together, especially when you forget to handle dependencies along the way. Simply starting all services in parallel and restarting those that terminate uses a lot of resources on larger machines, effectively slowing down the boot (yes, I did try that two years ago, though not with runit) under various circumstances instead of speeding it up. BTW: I ran across daemons before which didn't even have a --no-fork (or equivalent) option. Can't currently remember which though. Also, your run scripts miss an important part in the init system, which is easily possible with sysv-Initscripts but impossible with your run scripts as far as I can tell: Some daemons _need_ some cleanup actions to be performed after the daemon exits. In some cases the local admin might want to do something when a daemon is shut down (e.g. create a dump of some important database when the database server is stopped, or notify a remote system of the shutdown). Also, I have seen daemons which simply disable parts of their functionality if some other dameon those parts depend on isn't available at startup. How do you handle that with runit? Also, sysvinit allows to reload/force-reload some daemon, how do you handle that with runit? I can't see how you do that. What I really expect of any init system are various things: 1) Make sure no service is started when its dependencies are not met 2) Allow a graceful shutdown, taking services down before their dependencies are stopped 3) Allow manual stopping and starting of services, handling dependencies and giving feedback what services were actually started/stopped or failed to start/stop 4) Allow some equivalent to the /etc/init.d/<service> (force-)?reload functionality On a truely dependency based init system, I would also expect the system to allow the local admin to: a) ask the system which services some service depends on b) ask the system which services depend on some service c) manipulate the dependencies of a service optionally, allowing the addition of some dependency checking script to the system would of course be nice, but could be worked around by adding a pseudo-service and depend on that. Unfortunately, I currently don't see either runit nor initng fulfilling my expectations. Correct me if I'm wrong, stating how to do the above on your favorite new system. cu, sven
signature.asc
Description: OpenPGP digital signature
_______________________________________________ initscripts-ng-devel mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/initscripts-ng-devel

