zcip works in foreground but fails as daemon
David Daney
ddaney at avtrex.com
Fri Apr 6 17:13:58 UTC 2007
dlclark at chtech.com wrote:
> 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.
>
You don't say which version of busybox/zcip.
It could be this problem:
http://www.busybox.net/lists/busybox/2007-February/026359.html
> 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
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/cgi-bin/mailman/listinfo/busybox
More information about the busybox
mailing list