Subject: ip-up Script Not Running
To: None <netbsd-help@netbsd.org>
From: Randy Beaudreault <maccult@pacbell.net>
List: netbsd-help
Date: 04/06/2002 10:16:13
Hello all,

I'm trying to figure out why my ip-up script is not running.  I'm 
using PPPoE for my ADSL connection protocol and I'm trying to run a 
dyndns.org site via this.  I'm using ddclient as my update agent and 
using the prepackage ip-up script with modifications for my local 
environment.  The troubleI'm having is that I can run the script 
manually using Here's the script:
#!/bin/sh
######################################################################
## $Header: /home/paul/src/ddclient/RCS/sample-etc_ppp_ip-up.local,v 
3.5 2001/08/25 14:22:00 root Exp root $
######################################################################
##
## On my host, pppd invokes this script with args:
## /etc/ppp/ip-up.local ppp0 /dev/pts/1 115200 192.168.2.1 192.168.2.3
##
## From the manual page for my pppd, these aguments are:
##   scriptname interface-name tty-device speed local-IP-address 
remote-IP-address ipparam
##
## Some people have reported that their pppd returns their
## local-IP-address as $3.  If that's also the case for you,
## you may need to change the $4 below to $3.  This may not
## be necessary if you pppd also passes the local-ip-address
## in the environment as either PPP_LOCAL or IPLOCAL.
##
######################################################################
PATH=/usr/sbin:/root/bin:${PATH}
IP=
IP=${IP:-$PPP_LOCAL}
IP=${IP:-$IPLOCAL}
IP=${IP:-$3}

## update the DNS server unless the IP address is a private address
## that may be used as a internal LAN address (or PPtP tunnel).

logger -t ddclient $0 $*
case "$IP" in
10.*)           ;;
172.1[6-9].* | 172.2[0-9].* | 172.31.*) ;;
192.168.*)      ;;
"")             logger -t ddclient No local IP given so cannot update
                 ;;
*)              (
                         sleep 5
                         ddclient -daemon=0 -syslog -use=if 
-if=$1 >/dev/null 2>&1
                 ) &
                 ;;
esac
As I understand this script, it just calls ddclient with the 
arguments listed.  Why isn't this script running after being called 
by the ppp process?  I can run the console echoed ip-up line manually 
with no problems.

One thing I do notice is this line from my dmesg:
starting local daemons:/usr/pkg/etc/rc.d/ddclient: WARNING: $ddclient 
is not set properly.
I would guess that a problem with this rc script is the 
${ddclient_flags} and ${command_args} variables since they don't seem 
to get set anywhere in this script.  How can I fix those and the 
above $ddclient not set properly?
#!/bin/sh
#
# $NetBSD: ddclient.sh,v 1.3 2002/02/05 06:04:38 jlam Exp $
#
# Dynamic DNS update client
#
# PROVIDE: ddclient
# REQUIRE: DAEMON

if [ -f /etc/rc.subr ]
then
         . /etc/rc.subr
fi

name="ddclient"
rcvar=${name}
command="/usr/pkg/bin/perl"
daemon="/usr/pkg/sbin/${name}"
pidfile="/var/run/${name}.pid"
required_files="${daemon} /usr/pkg/etc/${name}.conf"
start_cmd="ddclient_start"
extra_commands="reload"

ddclient_start()
{
         echo "Starting ${name}."
         ${daemon} ${ddclient_flags} ${command_args}
}

if [ -f /etc/rc.subr ]
then
         load_rc_config $name
         run_rc_command "$1"
else
         echo -n " ${name}"
         ${daemon} ${ddclient_flags} ${command_args}
fi

-- 
Randy

OS X - UNIX for the rest of us
NetBSD - Catch the Power!