Gmane
X-Face
From: Wolfram Schlich <lists <at> schlich.org>
Subject: rc-scripts/init: new service dependency
Newsgroups: gmane.linux.gentoo.devel
Date: 2003-05-05 20:23:36 GMT (6 years, 8 weeks, 5 days, 12 hours and 49 minutes ago)
Hi,

I just switched my internet gateway from a heavily handpatched SuSE 7.3 
to Gentoo 1.4rc4. So far it *works* :o)
My setup is:

	/etc/init.d/net.eth1 (PPPoE-device):
		-> provide net.eth-dsl (virtual provide)

	/etc/init.d/net.ppp0 (DSL-iface):
		-> need net.eth-dsl (virtual provide from net.eth1)
		-> provide net.internet (virtual provide)

	/etc/init.d/ddclient (DynDNS.org updater):
		-> need net.internet (virtual provide from net.ppp0)

This works *so far*:
--8<--
[root <at> chiron(pts/2):tmp]$ rcddclient start
 * Bringing eth1 up... [ ok ]
 * Starting pppd (ppp0)... [ ok ]
 * Starting DDClient... [ ok ]
[root <at> chiron(pts/2):tmp]$ rcnet.eth1 stop
 * Stopping DDClient... [ ok ]
 * Stopping pppd (ppp0)... [ ok ]
 * Bringing eth1 down... [ ok ]
[root <at> chiron(pts/2):tmp]$
--8<--

What I tried to do now is the following: when net.ppp0 is started,
ddclient should be started automatically as well. I've found no
dependency-way to do this (except making net.ppp0 need ddclient, which
turns out to be kinda logical loop, despite the fact it seems to work in
practice... still feels bad).

What about a new dependency like "triggeredby"?
Another name could be "stickto"...
This would/should/could both affect "start" and "stop" operations. E.g.:

	/etc/init.d/ddclient:
		-> triggeredby net.ppp0
		-> after net.ppp0

This would cause ddclient to be started when net.ppp0 is started, but
due to the "after" dep, it would be started *after* net.ppp0.
Kinda reverse/twisted need dependency... or something.

This "triggeredby" could be applied to e.g. squid, iptables, postfix... all the
stuff you *might* choose to need when connecting to the internet but
don't want to start before you *really* connect.

Comments please.
-- 
Wolfram Schlich; Friedhofstr. 8, D-88069 Tettnang; +49-(0)178-SCHLICH

--
gentoo-dev <at> gentoo.org mailing list