[Initscripts-ng-devel] Defining the workgroup objectives

Sven Mueller debian at incase.de
Wed Jul 27 12:58:42 UTC 2005

paddy wrote on 26/07/2005 22:10:
>>7) A service should be able to declare several relations to other
>>   services:
>>   Provides, Conflicts, Depends, Before
> I miss Intercal's COME FROM in other languages ;)
> I take it Before is the reverse depends that enables old services to
> depend on new services (see above).

Not purely that. Imagine having postfix (the MTA) installed. Postfix
_doesn't_ depend on postgrey (it can usually run just fine without it),
but if you have postgrey installed, you will most probably want it to
start before postfix is started (so that postfix can use it and doesn't
cause a temporary delivery failure because it can't reach its policy
dameon). If postfix isn't configured to use the postgrey policy daemon,
it doesn't hurt to start that daemon before starting postfix. However,
if the local admin configures postfix to use that daemon, it should
really be run before postfix.
Come to think of it, it would be cool if a service could determine its
dependencies dynamically from its configuration. Which would mean that
the dependency information would be generated by a script. Oh boy,
that's not going to be easy to do I think.

> In that case, every old service
> needs to call into the dependency system to get its dependcies
> fullfilled?

If it can call into the dependency system, it would be just as easy to
enter its dependencies right into that system.

> Perhaps /sbin/service service start needs to replace
> /etc/init.d/service start?


> Does direct execution of /etc/init.d/service
> need to be prevented or made more dificult under such a system ?

I hope not.

> or does it get you non-dependency semantics ?

Likely, but I would still hope that it could work with dependencies.

> Is there any rule says one init.d script can't call another one directly ?

I don't think so. Actually I already thought about a minimal parallel
execution of scripts init extension for my servers:
For all scripts in /etc/rc<runlevel>.d/K??<service>:
- For each numeric tag: Call all scripts with that tag in parallel and
  wait for all of them to complete. Then go to the next tag (in numeric
  order of course)
For all scripts in /etc/rc<runlevel>.d/S??<service>:
- For each numeric tag: Call all scripts with that tag in parallel and
  wait for all of them to complete. Then go to the next tag (in numeric
  order of course)
And then to manually shift the services so that as many of them as
possible are executed in parallel.
This would be fairly easy to implement as those scripts are called from
/etc/init.d/rc anyway (which is a shell script).

>>Regarding 7: I could see some occasions where a service wants to be
>>started _and_ stopped before some other service is started or stopped,
>>while the normal situation would be if X requests to be started before Y
>> that it would be stopped after Y is stopped.
> Cool! example ?

I assume the start-X-before-Y&stop-X-before-Y case?

Firewall with a deny-all policy when stopped:
You want the firewall to start before any service daemon is started so
that they don't fail in DNS lookups or delivering of mails or whatever
they do at startup. However, you _might_ also want to close all ports
quickly before shutting down the services, so no new requests come in
during shutdown.
A pretty constructed example, but still a valid example.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 186 bytes
Desc: OpenPGP digital signature
Url : http://lists.alioth.debian.org/pipermail/initscripts-ng-devel/attachments/20050727/edb83fbb/signature.pgp

More information about the initscripts-ng-devel mailing list