* rehan khan [2008-01-13 10:35:40 -0000]: >> >> Fortunately, I don't have one run script that's more than 4 or 5 >> >> lines, and most of that is whitespace :) >> > >> >Lucky you. >> >You don't run mysql, do you? >> >> I do, but it could be done in less than 5 lines. My current runscript >> for mysql is 29 lines, but a lot of that is error checking and settting >> variables, none of which would be required for a single person who knows >> what he's doing. >> >> mysqld is no more complex than anything else. >> > >I think this is one of the problems with why runit has had slower takeup and initng and upstart are stealing it's thunder, in the major distro arena - no offence to the fine annvix distro. Much of the documentation available on the net provide these highly abreviated init scripts which might only apply to linux (runit is multi OS). This is not actually what is required in a general purpose OS. The scripts need to be complete in the sense that they can cope with most things thrown at them including incomplete configurations, initial startups etc. In fact when one gets to mad java apps like Tomcat and Hsqldb the scripts become nightmares as they have to cope with so many OS's and java versions and such like. > >mysqld is an interesting example. On a freshly installed OS nothing is initialised for mysql. How would one cope with this situation? The fedora scripts ask the user for input and setup initial databases. Depends on the OS. For annvix, the default database is setup when the rpm is installed. I believe most distros do something similar... granted, I don't use much beyond annvix and mandriva, but I can't imagine anyone thinking that an initscript is a good place to be asking for user configuration. Initscripts should be non-interactive... it certainly isn't the right place to be asking users for configuration info. >Runit does not have any in-built mechanism for this this scenario and it needs to be built into the supporting scripts. Runit also does not have any mechanism to signal the system that user input is required and that all other services should not write to the console while this is happening. Runit also does not have a mechanism to signal that a particular services needs to have exclusive access to the system (useful if one wants to migrate the rc.sysinit script to a bunch of runit services). The scripts built around runit need to take care of these situations. At the end of startup there needs to be some kind of indication that services have failed/succeeded for some reason otherwise they may go un-noticed. This could be useful, granted, but doesn't necessarily need to be done by runit. A simple script called after everything gets started could check to see what is down and should be up, then report on those. with annvix, we use a frontend to sv called srv, and srv --list will tell you what is up, down, should be up, when it changed state, etc. But I don't think runit needs to change to allow people to execute configuration during service startup becuase I think these services should be configured before they're told to start. Distros that use initscripts to setup services themselves are, imho, bastardizing what initscripts were designed for in a very wrong way. >In some ways I think runsvdir could use some additional functionality and I am thinking of re-implementing it in python. Runsvdir does in effect supervise all the runsv processes (when it is used) and would be a good place to co-ordinate this kind of activity (process signalling, holding a dependancy database). I probably need to do this anyway to get Linux Standards Base compliance. > >It would be nice to see a collection of multi-OS (linux, bsd etc) init scripts somewhere out there. Perhaps if someone could help me out with the cvs/svn setup on the fedorafastboot project we can get a general script repository setup? The annvix svn is open and we have runscripts for a number of services that can easily be cherrypicked by anyone interested. http://svn.annvix.org/. -- Vincent Danen @ http://linsec.ca/