On Saturday 16 August 2003 18:35, Olivier Blin wrote:
> Hi,
>
> I've found some weird things in /etc/ppp/ip-up
>
> 1) what's this trick for PPP_TEMP_ENTRY ?
> # for dynamic DNS support with gnome-ppp and kppp and draknet
> if grep -i '#.*ppp temp entry' /etc/resolv.conf >& /dev/null ; then
>     PPP_TEMP_ENTRY=`grep '#.*ppp temp entry' /etc/resolv.conf | \
>        tail -1 | sed 's/.*ppp temp entry/# ppp temp entry/' `
> else
>     unset PPP_TEMP_ENTRY
> fi
>
> Why use this grep | tail | sed ? The result should always be "# ppp
> temp entry"
>
> 2) kppp now writes temp entries in /etc/resolv.conf after
> /etc/ppp/ip-up is run, gnome-ppp isn't supported anymore, and
> drakconnect uses kppp (it even run it as root ...), so there is no
> need to check for "#.*ppp temp entry" here ...
> "grep -i '#.*ppp temp entry' /etc/resolv.conf" will never match here.
> So PPP_TEMP_ENTRY will never be set.
>
> 3) Since PPP_TEMP_ENTRY is always unset, the script never writes DNS
> in /etc/resolv.conf
> This is a problem when pppd or wvdial are used to establish the
> connection.
>
> if [ -n "$PPP_TEMP_ENTRY" ]; then
>     [ -n "$DNS1" ] && \
>       echo -e "nameserver $DNS1 $PPP_TEMP_ENTRY" >>/etc/resolv.conf
>     [ -n "$DNS2" ] && \
>       echo -e "nameserver $DNS2 $PPP_TEMP_ENTRY" >> /etc/resolv.conf
> fi
>
>
> I propose to drop all this "if grep -i '#.*ppp temp entry'
> /etc/resolv.conf" and "if [ -n "$PPP_TEMP_ENTRY" ]" blocks and to
> replace them with :
>
> PPP_TEMP_ENTRY="# ppp temp entry"
> [ -n "$DNS1" ] && \
>     echo -e "nameserver $DNS1 $PPP_TEMP_ENTRY" >>/etc/resolv.conf
> [ -n "$DNS2" ] && \
>     echo -e "nameserver $DNS2 $PPP_TEMP_ENTRY" >> /etc/resolv.conf
>
>
> Have I missed something ?
> For dialup users, with the current ip-up script, only kppp sets
> dynamic DNS in /etc/resolv.conf (it doesn't use the ip-up to do that)

I would also add something to replace if-up.local

[ -x /etc/ppp/ip-up.local ] && /etc/ppp/ip-up.local "$@"

replaced by

if [ -d /etc/ppp/ifup-ppp.d -a -x /usr/bin/run-parts ]; 
then   
  /usr/bin/run-parts --arg "$@" /etc/ppp/ipup.d/
fi

then just drop a script to call /etc/ppp/ipup.local in 
/etc/ppp/ipup-ppp.d, for backward compatibility.

the same applis for ipdown.local .

This would also mean we can remove the piece of code to flush sendmail 
queue, and put it in a separate script, to be cleaner.


the second problem i see is that each file dropped in
/etc/sysconfig/network-scripts/ifup.d/, are not executed with pppd.

to give a small example ( and the only one i see ), wshaperx does not 
work out of the box, on a adsl connection.

it seems that this line :

[ -f /etc/sysconfig/network-scripts/ifcfg-${LOGDEVICE} ] && 
/etc/sysconfig/network-scripts/ifup-post ifcfg-${LOGDEVICE}

never call ifup-post, because $LOGDEVICE is always unset.
at least for adsl and RTC connection. I know that it also handle ppp 
connection for Isdn and maybe for tunnel, so this line is maybe for 
this kind of connection.

removing this line and dropping a script in /etc/ppp/ipup.d/ could be a 
solution. 

I think this solution can be more flexible than the current one.

did i forget someting ?
is it possible to replace the script in the current package ?

-- 

Michaël Scherer


Reply via email to