martin f krafft wrote: >also sprach Fabio Fabbri <[EMAIL PROTECTED]> [2005.08.22.2021 +0200]: > > >>/ect/init.d/rc can launch startup scripts with "startup $i start &", so >>scripts are executed concurrently; but startup() must be modified and >>should ask to bogoserver if the script dependencies are satisfied. After >>the script is executed, startup() must notify this to bogoserver. >> >> > >What's the advantage of this scheme over using semaphores in >/var/run ? > > I must admit I didn't know this kind of semaphores. However I think solve this kind of problem with semaphores is harder than using monitors or message passing. I don't know how to use monitors under bash, so I implemented this using message passing through TCP and writing a server as a first try.
Moreover, this kind of server is flexible and can receive messages from a service when it's partially started. For example it can receive a notification from hotplug or udev when sound card or network card is available, then a script that was waiting for these devices can be executed without wait for all the execution of hotplug. And last, if deadlock occurs, you can unlock easily sending the right message. >>Then startup() can send a message to bogoserver for each dependency. >>Unfortunately, Debian's bash doesn't supports TCP, so we must use netcat >> >> > >... or perl, or python, or C. > > ... or enabling TCP in bash. This is a documented feature of bash 2, but it was disabled and the man page reports a feature that is not available. I think bash should be recompiled with TCP support, otherwise the manual should be modified! If we must use a program not built in bash, we can write a little client that uses a local socket file. _______________________________________________ initscripts-ng-devel mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/initscripts-ng-devel

