• Bug#264894: #264894

    From Thomas Hood@1:229/2 to All on Tue Aug 17 22:00:15 2004
    From: [email protected]

    Thanks for pointing out this problem.

    Using the "sort" program isn't appropriate because it is located
    in /usr/bin/ whereas mountnfs.sh can run when /usr/ isn't yet
    mounted. Instead you can use a function like this:

    # Stores arguments (minus duplicates) in RSLT, separated by spaces
    # Doesn't work properly if an argument itself contain whitespace
    uniquify()
    {
    RSLT=""
    while [ "$1" ] ; do
    for E in $RSLT ; do
    [ "$1" = "$E" ] && { shift ; continue 2 ; }
    done
    RSLT="${RSLT:+$RSLT }$1"
    shift
    done
    }

    To use this function do:

    uniquify $NETFS
    for fstype in $RSLT
    do
    mount -a -t $fstype
    done

    --
    Thomas



    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Miquel van Smoorenburg@1:229/2 to Thomas Hood on Tue Aug 17 23:00:15 2004
    From: [email protected]

    On Tue, 17 Aug 2004 21:41:21, Thomas Hood wrote:
    Thanks for pointing out this problem.

    Using the "sort" program isn't appropriate because it is located
    in /usr/bin/ whereas mountnfs.sh can run when /usr/ isn't yet
    mounted. Instead you can use a function like this:

    I think a better way is to let mount sort this out. I read
    the code and you can actually do mount -a -ttype,type,type
    where "type" is duplicated - mount handles that just fine
    without trying to mount stuff several times.

    It even allows trailing comma's, which simplifies things
    quite a bit - just add "type," to NETFS in the loop instead of
    "type " then mount -a -t $NETFS

    This should probably go into the proposed-updates upload.

    Mike.


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Thomas Hood@1:229/2 to Miquel van Smoorenburg on Wed Aug 18 11:00:14 2004
    From: [email protected]

    On Tue, 2004-08-17 at 22:31, Miquel van Smoorenburg wrote:
    On Tue, 17 Aug 2004 21:41:21, Thomas Hood wrote:
    Thanks for pointing out this problem.

    Using the "sort" program isn't appropriate because it is located
    in /usr/bin/ whereas mountnfs.sh can run when /usr/ isn't yet
    mounted. Instead you can use a function like this:

    I think a better way is to let mount sort this out.


    Letting mount sort it out would be tidier. However, considering
    code quality of the mount program, I would be very hesitant about
    exercising a new feature of mount at this stage of the release
    process.


    This should probably go into the proposed-updates upload.


    How important is it to fix this bug? If not important then we
    can deal with it later in the way you suggest. If it is important
    to fix it now then I would vote for the "uniquify" approach.
    Your call, of course.
    --
    Thomas



    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Miquel van Smoorenburg@1:229/2 to Thomas Hood on Wed Aug 18 11:50:10 2004
    From: [email protected]

    On 2004.08.18 10:39, Thomas Hood wrote:
    On Tue, 2004-08-17 at 22:31, Miquel van Smoorenburg wrote:
    On Tue, 17 Aug 2004 21:41:21, Thomas Hood wrote:
    Thanks for pointing out this problem.

    Using the "sort" program isn't appropriate because it is located
    in /usr/bin/ whereas mountnfs.sh can run when /usr/ isn't yet
    mounted. Instead you can use a function like this:

    I think a better way is to let mount sort this out.


    Letting mount sort it out would be tidier. However, considering
    code quality of the mount program, I would be very hesitant about
    exercising a new feature of mount at this stage of the release
    process.

    You're probably right. It wasn't that hard to fix properly, btw.

    This should probably go into the proposed-updates upload.

    How important is it to fix this bug? If not important then we
    can deal with it later in the way you suggest. If it is important
    to fix it now then I would vote for the "uniquify" approach.
    Your call, of course.

    It was not that hard to fix, and I don't think there's something
    wrong with the below - it's similar to your proposed solution:

    --- /etc/init.d/mountnfs.sh 2004-07-29 12:34:05.000000000 +0200
    +++ mountnfs.sh 2004-08-18 11:17:32.000000000 +0200
    @@ -7,7 +7,7 @@
    # Also mounts SMB filesystems now, so the name of
    # this script is getting increasingly inaccurate.
    #
    -# Version: @(#)mountnfs.sh 2.85-23 29-Jul-2004 [email protected]
    +# Version: @(#)mountnfs.sh 2.86-2 18-Aug-2004 [email protected]
    #

    VERBOSE=yes
    @@ -49,12 +49,26 @@
    portmap=yes
    ;;
    esac
    - NETFS="$NETFS $fstype"
    ;;
    smbfs|cifs|coda|ncp|ncpfs)
    - NETFS="$NETFS $fstype"
    + ;;
    + *)
    + fstype=
    ;;
    esac
    + if [ -n "$fstype" ]
    + then
    + case "$NETFS" in
    + $fstype|*,$fstype|$fstype,*|*,$fstype,*)
    + ;;
    + "")
    + NETFS="$fstype"
    + ;;
    + *)
    + NETFS="$NETFS,$fstype"
    + ;;
    + esac
    + fi
    done

    exec 0>&1
    @@ -72,10 +86,7 @@
    if [ -n "$NETFS" ]
    then
    echo "Mounting remote filesystems..."
    - for fstype in $NETFS
    - do
    - mount -a -t $fstype
    - done
    + echo mount -a -t$NETFS
    fi

    ) < /
  • From Thomas Hood@1:229/2 to Miquel van Smoorenburg on Wed Aug 18 16:10:13 2004
    From: [email protected]

    On Wed, 2004-08-18 at 11:24, Miquel van Smoorenburg wrote:
    It was not that hard to fix, and I don't think there's something
    wrong with the below - it's similar to your proposed solution:


    Your patch looks right to me.
    --
    Thomas



    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)