zcip works in foreground but fails as daemon

dlclark at chtech.com dlclark at chtech.com
Fri Apr 6 16:29:37 UTC 2007


What am I missing?  Running zcip from the command prompt with the –f or –v option gets me an IP address, but if I run it as a daemon it does not.  Unfortunately it does not give me any indication why.  I suspect that syslog may give me more info but I don’t have it up and running.  I figure this is something simple.  I’ve tried two scripts as seen below.

David Clark

<<<<<<<<<<<<< zcip.script >>>>>>>>>>>>>>>>>
#!/bin/ash

# only for use as a "zcip" callback script
if [ "x$interface" = x ]
then
	exit 1
fi

# zcip should start on boot/resume and various media changes
case "$1" in
init)
	# for now, zcip requires the link to be already up,
	# and it drops links when they go down.  that isn't
	# the most robust model...
	exit 0
	;;
config)
	if [ "x$ip" = x ]
	then
		exit 1
	fi
exec ip address add dev $interface \
		scope link local "$ip/16" broadcast +
	exit 0
;;
deconfig)
	if [ x$ip = x ]
	then
		exit 1
	fi
	exec ip address del dev $interface local $ip
	exit 0
;;
esac
exit 1

<<<<<<<<<<<<< zcip-2.script >>>>>>>>>>>>>>>>>
#!/bin/ash

# only for use as a "zcip" callback script
if [ "x$interface" = x ]
then
	exit 1
fi

# zcip should start on boot/resume and various media changes
case "$1" in
init)
	# for now, zcip requires the link to be already up,
	# and it drops links when they go down.  that isn't
	# the most robust model...
	/sbin/ifconfig $interface up
	exit 0
	;;
config)
	if [ "x$ip" = x ]
	then
		exit 1
	fi
	/sbin/ifconfig $interface $ip netmask 255.255.0.0
	exit 0
;;
deconfig)
	if [ x$ip = x ]
	then
		exit 1
	fi
	/sbin/ifconfig $interface down
	exit 0
;;
esac
exit 1



More information about the busybox mailing list