Bug#631077: typo in /etc/network/if-up.d/mountnfs

2011-11-24 Thread Roger Leigh
On Thu, Nov 24, 2011 at 04:24:21PM +1100, Chris Dunlop wrote:
 On Mon, Jun 20, 2011 at 10:55:17AM +0200, Milan Kocian wrote:
  Older versions of grep  seems ok.
 
 It's definately a bug in the script, not grep: the newer grep is simply
 reporting what must be a common problem. The script is trying to allow
 for possible spaces at the beginning of the line, but failing with
 the incorrect regular expression:

Please could you try the latest git commit at

http://anonscm.debian.org/gitweb/?p=collab-maint/sysvinit;a=blob_plain;f=debian/src/initscripts/etc/network/if-up.d/mountnfs;h=e5c1dba385e89eafb3eed1acc9042f6cd0269360;hb=19dccaa3e52703ae051bb8fa266ad9396df8fd5b

Which should fix this (and other) problems with the script.


Thanks,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#631077: typo in /etc/network/if-up.d/mountnfs

2011-11-24 Thread Chris Dunlop
On Thu, Nov 24, 2011 at 11:38:12AM +, Roger Leigh wrote:
 On Thu, Nov 24, 2011 at 04:24:21PM +1100, Chris Dunlop wrote:
 On Mon, Jun 20, 2011 at 10:55:17AM +0200, Milan Kocian wrote:
 Older versions of grep  seems ok.
 
 It's definately a bug in the script, not grep: the newer grep is simply
 reporting what must be a common problem. The script is trying to allow
 for possible spaces at the beginning of the line, but failing with
 the incorrect regular expression:
 
 Please could you try the latest git commit at
 
 http://anonscm.debian.org/gitweb/?p=collab-maint/sysvinit;a=blob_plain;f=debian/src/initscripts/etc/network/if-up.d/mountnfs;h=e5c1dba385e89eafb3eed1acc9042f6cd0269360;hb=19dccaa3e52703ae051bb8fa266ad9396df8fd5b
 
 Which should fix this (and other) problems with the script.

It works for me!

And the cleaned up 'while' loop looks far better than before.

Cheers,

Chris.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#631077: typo in /etc/network/if-up.d/mountnfs

2011-11-23 Thread Chris Dunlop
On Mon, Jun 20, 2011 at 10:55:17AM +0200, Milan Kocian wrote:
 hello,
 
 may be I am wrong and it's problem with grep. I see this problem only with
 newest grep package:
 
 root@ntm:~# grep --version
 grep (GNU grep) 2.8
 Copyright (C) 2011 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 
 Written by Mike Haertel and others, see 
 http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS.
 
 
 root@ntm:/etc/apt# grep ^[:space:]*auto /etc/network/interfaces
 grep: character class syntax is [[:space:]], not [:space:]
 
 
 Older versions of grep  seems ok.

It's definately a bug in the script, not grep: the newer grep is simply
reporting what must be a common problem. The script is trying to allow
for possible spaces at the beginning of the line, but failing with
the incorrect regular expression:

  echo auto | grep ^[:space:]*auto   # works
  auto

  echo  auto | grep ^[:space:]*auto  # doesn't work

And with the proper regular expression:

  echo  auto | grep ^[[:space:]]*auto# works
   auto

  echo auto | grep ^[[:space:]]*auto # works
  auto

Of course it's only going to bite people that have an 'auto' line that
starts with spaces but if they do then this problem is will cause them a
problem that's very hard to track down!

Cheers,

Chris



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#631077: typo in /etc/network/if-up.d/mountnfs

2011-10-10 Thread Corey Hickey
Wow, this bug drove me nuts when I was doing some unrelated reboots
yesterday.

That whole function seems kind of strange to me (making a directory to
pass state from one part of the function to another...?).

Here's a patch that makes the function seem cleaner to me, if anybody
wants it.

-Corey
Index: debian/src/initscripts/etc/network/if-up.d/mountnfs
===
--- debian/src/initscripts/etc/network/if-up.d/mountnfs (revision 1966)
+++ debian/src/initscripts/etc/network/if-up.d/mountnfs (working copy)
@@ -117,20 +117,15 @@
 }
 
 exit_unless_last_interface() {
-grep ^[:space:]*auto /etc/network/interfaces  | \
-   sed -e 's/[ \t]*auto[ \t]*//;s/[ \t]*$//;s/[ \t]/\n/g' | \
-   while read i; do
-   if [ `grep -c $i /etc/network/run/ifstate` -eq 0 ]; then
+ifaces=$(grep ^[[:space:]]*auto /etc/network/interfaces  | \
+sed -e 's/[ \t]*auto[ \t]*//;s/[ \t]*$//;s/[ \t]/\n/g')
+for i in $ifaces ; do
+   if grep -q $i /etc/network/run/ifstate ; then
msg=if-up.d/mountnfs[$IFACE]: waiting for interface $i before 
doing NFS mounts
log_warning_msg $msg
-   # Can not pass this as a variable because of the while subshell
-   mkdir /var/run/network/mountnfs_earlyexit 2 /dev/null
+   exit 0
fi
 done
-if [ -d /var/run/network/mountnfs_earlyexit ]; then
-   rmdir /var/run/network/mountnfs_earlyexit 2/dev/null
-   exit 0
-fi
 }
 
 # Using 'no !=' instead of 'yes =' to make sure async nfs mounting is


Bug#631077: typo in /etc/network/if-up.d/mountnfs

2011-07-27 Thread Dennis Boone
Note that one result of this bug is long delays in mounting nfs file
systems at boot, because the test never lists any interfaces to test for
up-ness.

De



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#631077: typo in /etc/network/if-up.d/mountnfs

2011-06-20 Thread Milan Kocian
hello,

may be I am wrong and it's problem with grep. I see this problem only with
newest grep package:

root@ntm:~# grep --version
grep (GNU grep) 2.8
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see 
http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS.


root@ntm:/etc/apt# grep ^[:space:]*auto /etc/network/interfaces
grep: character class syntax is [[:space:]], not [:space:]


Older versions of grep  seems ok.

Best regards,

-- 
Milan Kocian



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#631077: typo in /etc/network/if-up.d/mountnfs

2011-06-19 Thread Milan Kocian
Package: initscripts
Version: 2.88dsf-13.10

Hello,

I found small typo in /etc/network/if-up.d/mountnfs script. This patch
should correct it:

--- mountnfs.old2011-06-20 00:18:40.031504616 +0200
+++ mountnfs2011-06-20 00:18:54.997317517 +0200
@@ -117,7 +117,7 @@
 }
 
 exit_unless_last_interface() {
-grep ^[:space:]*auto /etc/network/interfaces  | \
+grep ^[[:space:]]*auto /etc/network/interfaces  | \
sed -e 's/[ \t]*auto[ \t]*//;s/[ \t]*$//;s/[ \t]/\n/g' | \
while read i; do
if [ `grep -c $i /etc/network/run/ifstate` -eq 0 ]; then
 


Best regards,

-- 
Milan Kocian



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org