Public bug reported:

Binary package hint: ppp

When the ppp daemon establishes a connection, the /etc/ppp/ip-
up.d/0000usepeerdns file is executed (after, the corresponding ip-
down.d/0000usepeerdns file is also executed).

Where the pppd "usepeerdns" config options is used (most cases), the
0000usepeerdns scripts test for the nscd (name service cache daemon)
being running incorrectly [1], so does not restart it.

The correct pid file to test for is /var/run/nscd/nscd.pid. Also, rather
than restarting the service and flushing everything, it is better to
invalidate just the hosts [2].

Diff against original files is in [3]. Apply with 'patch -l'.

--- [1]

if [ -e /var/run/nscd.pid ]; then
  /etc/init.d/nscd restart || true
fi

--- [2]

[ -e /var/run/nscd/nscd.pid ] && nscd -i hosts

--- [3]

--- ip-up.d/0000usepeerdns.orig 2007-01-16 18:06:12.000000000 +0000
+++ ip-up.d/0000usepeerdns      2007-01-16 18:06:57.000000000 +0000
@@ -25,8 +25,8 @@
 mv -f "$REALRESOLVCONF.tmp" "$REALRESOLVCONF"
 
 # restart nscd because resolv.conf has changed
-if [ -e /var/run/nscd.pid ]; then
-  /etc/init.d/nscd restart || true
+if [ -e /var/run/nscd/nscd.pid ]; then
+  nscd -i hosts
 fi
 
 exit 0

--- ip-down.d/0000usepeerdns.orig       2007-01-16 18:08:58.000000000 +0000
+++ ip-down.d/0000usepeerdns    2007-01-16 18:09:20.000000000 +0000
@@ -15,8 +15,8 @@
   mv -f $REALRESOLVCONF.pppd-backup $REALRESOLVCONF
 
   # restart nscd because resolv.conf has changed
-  if [ -e /var/run/nscd.pid ]; then
-    /etc/init.d/nscd restart || true
+  if [ -e /var/run/nscd/nscd.pid ]; then
+    nscd -i hosts
   fi
 fi

** Affects: ppp (Ubuntu)
     Importance: Undecided
         Status: Unconfirmed

** Description changed:

  Binary package hint: ppp
  
  When the ppp daemon establishes a connection, the /etc/ppp/ip-
- up.d/0000usepeerdns file is executed.
+ up.d/0000usepeerdns file is executed (after, the corresponding ip-
+ down.d/0000usepeerdns file is also executed).
  
  Where the pppd "usepeerdns" config options is used (most cases), the
- 0000usepeerdns script tests for the nscd (name service cache daemon)
+ 0000usepeerdns scripts test for the nscd (name service cache daemon)
  being running incorrectly [1], so does not restart it.
  
- The correct pid file to test for is /var/run/nscd/nscd.pid. Rather than
- restarting the service and flushing everything, it is better to
+ The correct pid file to test for is /var/run/nscd/nscd.pid. Also, rather
+ than restarting the service and flushing everything, it is better to
  invalidate just the hosts [2].
  
- Diff against original file is in [3]. Apply with 'patch -l'.
+ Diff against original files is in [3]. Apply with 'patch -l'.
  
  --- [1]
  
  if [ -e /var/run/nscd.pid ]; then
    /etc/init.d/nscd restart || true
  fi
  
  --- [2]
  
  [ -e /var/run/nscd/nscd.pid ] && nscd -i hosts
  
  --- [3]
  
- --- 0000usepeerdns.orig 2007-01-16 18:06:12.000000000 +0000
- +++ 0000usepeerdns      2007-01-16 18:06:57.000000000 +0000
+ --- ip-up.d/0000usepeerdns.orig 2007-01-16 18:06:12.000000000 +0000
+ +++ ip-up.d/0000usepeerdns      2007-01-16 18:06:57.000000000 +0000
  @@ -25,8 +25,8 @@
   mv -f "$REALRESOLVCONF.tmp" "$REALRESOLVCONF"
   
   # restart nscd because resolv.conf has changed
  -if [ -e /var/run/nscd.pid ]; then
  -  /etc/init.d/nscd restart || true
  +if [ -e /var/run/nscd/nscd.pid ]; then
  +  nscd -i hosts
   fi
   
   exit 0
+ 
+ --- ip-down.d/0000usepeerdns.orig       2007-01-16 18:08:58.000000000 +0000
+ +++ ip-down.d/0000usepeerdns    2007-01-16 18:09:20.000000000 +0000
+ @@ -15,8 +15,8 @@
+    mv -f $REALRESOLVCONF.pppd-backup $REALRESOLVCONF
+  
+    # restart nscd because resolv.conf has changed
+ -  if [ -e /var/run/nscd.pid ]; then
+ -    /etc/init.d/nscd restart || true
+ +  if [ -e /var/run/nscd/nscd.pid ]; then
+ +    nscd -i hosts
+    fi
+  fi

-- 
Get stale DNS information after PPP session starts
https://launchpad.net/bugs/79600

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to