start multiples processes

Mildred ml.mildred593 at online.fr
Fri Apr 20 23:28:41 BST 2007


Hi,

I'm tryint to replace my Arch init system with upstart. And I have to
translate an init script that spawn multiples processes. it is ifplugd.
It monitor the status of the interface (when the wire is un/pluged).
The current init script spawn as many ifplugd daemons as network
interfaces.
I just want to know it is possible to do the same with upstart ...

Here is my upstart script:

------------------------------------------
start on initialized
stop on shutdown

console output
respawn

script
	CFG="/etc/ifplugd/ifplugd.conf"
	if [ -f "$CFG" ]; then
		source "$CFG"
	fi
	if [ -z "$NET_IFS" ]; then
		NET_IFS=$(sed -ne
's/.*\<\(eth[0-9]*\):.*/\1/p' /proc/net/dev) fi
	for iface in $NET_IFS; do
		args="`eval echo \$\{ARGS_${IF}\}`"
		[ -z "$A" ] && args="$ARGS"
		ifplugd -i $iface $args
	done
end script

post-start script
	initctl emit arch.daemon add ifplugd
end script

post-stop script
	initctl emit arch.daemon rm ifplugd
end script

#kate: hl upstart; space-indent off; indent-width 8; tab-width 8;

-----------------------------------------------


PS: I just wrote a kwrite/kate syntax highlighting file for upstart
scripts if anyone is interrested.

PPS: I already sent this message but I didn'r revieved it back and it
didn't appeared in the mailing list archive, so i send itagain hoping
it won't be sent twice.

Also, I had another problem, A kernel panic. The message was like
"Panic: not syncing: attempted to kill init". What does it means, that
init died and the kernel don't know hat to do ?
I solved it removing the 'arch.daemon add|rm deamonname' message you
can see in my script.

Mildred

-- 
Mildred       <xmpp:mildred at jabber.fr> <http://mildred632.free.fr/>
Clef GPG :    <hkp://pgp.mit.edu> ou <http://mildred632.free.fr/gpg_key>
Fingerprint : 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 [9A7D 2E2B]



More information about the upstart-devel mailing list