discover1: "set -e" prevents cdrom mountpoint creation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
discover1 (Debian) |
Fix Released
|
Unknown
|
|||
discover1 (Ubuntu) |
Invalid
|
High
|
Daniel Stone |
Bug Description
Automatically imported from Debian bug report #276722 http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
|
#1 |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
|
#2 |
On Fri, Oct 15, 2004 at 11:00:13PM -0700, Joshua Kwan wrote:
> On Fri, Oct 15, 2004 at 11:56:16PM +0200, Farzad FARID wrote:
> > On my freshly installed Debian unstable, /etc/init.
> > create the symlinks in /dev and /media. I trace this down with "sh -x
> > /etc/init.
> > an error while grepping /proc/mounts, therefore never finishing its
> > job.
>
> Add set -e back, and does changing this line:
>
> mountsent="$(grep " $CDMOUNT " /proc/mounts)"
>
> to either
>
> mountsent=$(grep " $CDMOUNT " /proc/mounts)
>
> or
>
> mountsent=$(grep " $CDMOUNT " /proc/mounts || true)
In either case, removing quoting is surely the wrong answer. I'd do one
of these:
mountsent="$(grep " $CDMOUNT " /proc/mounts || true)"
mountsent="$(grep " $CDMOUNT " /proc/mounts)" || true
--
Colin Watson [<email address hidden>]
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
|
#3 |
on 16.10.2004 16:23 Colin Watson said the following:
>In either case, removing quoting is surely the wrong answer. I'd do one
>of these:
>
> mountsent="$(grep " $CDMOUNT " /proc/mounts || true)"
> mountsent="$(grep " $CDMOUNT " /proc/mounts)" || true
>
>
>
Both these solutions correct the problem. I let you choose the one you
prefer :)
Regards
--
Farzad FARID <email address hidden> http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
|
#4 |
On Sat, Oct 16, 2004 at 03:23:05PM +0100, Colin Watson wrote:
> In either case, removing quoting is surely the wrong answer. I'd do one
> of these:
>
> mountsent="$(grep " $CDMOUNT " /proc/mounts || true)"
> mountsent="$(grep " $CDMOUNT " /proc/mounts)" || true
I was under the impression that quoting wasn't required for $(...)
constructs, and that having the duplicate double quotes in the middle
would render void the intentional whitespace.
Are you sure this isn't breaking more than it fixes? :)
--
Joshua Kwan
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
|
#5 |
On Sat, Oct 16, 2004 at 09:11:48AM -0700, Joshua Kwan wrote:
> On Sat, Oct 16, 2004 at 03:23:05PM +0100, Colin Watson wrote:
> > In either case, removing quoting is surely the wrong answer. I'd do one
> > of these:
> >
> > mountsent="$(grep " $CDMOUNT " /proc/mounts || true)"
> > mountsent="$(grep " $CDMOUNT " /proc/mounts)" || true
>
> I was under the impression that quoting wasn't required for $(...)
> constructs,
Quoting's always good style in shell. As it happens, you get away
without it here because word splitting and pathname expansion are not
performed on the value in a name=value assignment, and those are the
only two expansions that happen after command substitution. All the
same, it promotes better practice to quote everywhere unless there's an
actively good reason not to do so.
> and that having the duplicate double quotes in the middle would render
> void the intentional whitespace.
No, shell quoting rules mean that the initial " doesn't get closed until
the $() is closed. Try it:
$ foo="$(echo " hello " " world ")"
$ echo "$foo"
hello world
> Are you sure this isn't breaking more than it fixes? :)
I always put double quotes around $(). Besides, you're the one
suggesting a change. :-)
Cheers,
--
Colin Watson [<email address hidden>]
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
|
#6 |
severity 276722 critical
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Debian Bug Importer (debzilla) wrote : | #7 |
Automatically imported from Debian bug report #276722 http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Debian Bug Importer (debzilla) wrote : | #8 |
Message-Id: <email address hidden>
Date: Fri, 15 Oct 2004 23:56:16 +0200
From: Farzad FARID <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: discover1: "set -e" prevents cdrom mountpoint creation
Package: discover1
Version: 1.7.2
Severity: important
On my freshly installed Debian unstable, /etc/init.
create the symlinks in /dev and /media. I trace this down with "sh -x
/etc/init.
an error while grepping /proc/mounts, therefore never finishing its
job.
If I suppress "set -e" at the beginning of the script, the symlinks
are correctly created.
Here is a partial output of "sh -x /etc/init.
[...]
+ aliases=
+ sed 's/ .*$//' /proc/modules
+ grep -qE '^(usb-uhci)$'
+ echo 'Skipping already loaded module usb-uhci.'
Skipping already loaded module usb-uhci.
+ continue
+ '[' true = true ']'
+ for CDMOUNT in '${CDROM_
++ grep ' /media/cdrom0 ' /proc/mounts
+ mountsent=
23:48 [root:pts/5] labyrinth# echo $?
1
Regards
-- Package-specific info:
lspci:
0000:00:00.0 0600: 8086:2584 (rev 04)
0000:00:00.0 Host bridge: Intel Corp. 925X Memory Controller Hub (rev 04)
0000:00:01.0 0604: 8086:2585 (rev 04)
0000:00:01.0 PCI bridge: Intel Corp. 925X PCI Express Root Port (rev 04)
0000:00:1c.0 0604: 8086:2660 (rev 03)
0000:00:1c.0 PCI bridge: Intel Corp. 82801FB/
0000:00:1c.1 0604: 8086:2662 (rev 03)
0000:00:1c.1 PCI bridge: Intel Corp. 82801FB/
0000:00:1d.0 0c03: 8086:2658 (rev 03)
0000:00:1d.0 USB Controller: Intel Corp. 82801FB/
0000:00:1d.1 0c03: 8086:2659 (rev 03)
0000:00:1d.1 USB Controller: Intel Corp. 82801FB/
0000:00:1d.2 0c03: 8086:265a (rev 03)
0000:00:1d.2 USB Controller: Intel Corp. 82801FB/
0000:00:1d.3 0c03: 8086:265b (rev 03)
0000:00:1d.3 USB Controller: Intel Corp. 82801FB/
0000:00:1d.7 0c03: 8086:265c (rev 03)
0000:00:1d.7 USB Controller: Intel Corp. 82801FB/
0000:00:1e.0 0604: 8086:244e (rev d3)
0000:00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev d3)
0000:00:1f.0 0601: 8086:2640 (rev 03)
0000:00:1f.0 ISA bridge: Intel Corp. 82801FB/FR (ICH6/ICH6R) LPC Interface Bridge (rev 03)
0000:00:1f.2 0101: 8086:2652 (rev 03)
0000:00:1f.2 IDE interface: Intel Corp. 82801FR/FRW (ICH6R/ICH6RW) SATA Controller (rev 03)
0000:00:1f.3 0c05: 8086:266a (rev 03)
0000:00:1f.3 SMBus: Intel Corp. 82801FB/
0000:01:00.0 0300: 1002:5b60
0000:01:00.0 VGA compatible controller: ATI Technologies Inc: Unknown device 5b60
0000:01:00.1 0380: 1002:5b70
0000:01:00.1 Display controller: ATI Technologies Inc: Unknown device 5b70
0000:02:00.0 0200: 14e4:1677 (rev 01)
0000:02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express (rev 01...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Debian Bug Importer (debzilla) wrote : | #9 |
Message-ID: <email address hidden>
Date: Fri, 15 Oct 2004 23:00:13 -0700
From: <email address hidden> (Joshua Kwan)
To: Farzad FARID <email address hidden>, <email address hidden>
Subject: Re: Bug#276722: discover1: "set -e" prevents cdrom mountpoint creation
--z6Eq5LdranGa6ru8
Content-Type: text/plain; charset=us-ascii
Content-
Content-
On Fri, Oct 15, 2004 at 11:56:16PM +0200, Farzad FARID wrote:
> On my freshly installed Debian unstable, /etc/init.
> create the symlinks in /dev and /media. I trace this down with "sh -x
> /etc/init.
> an error while grepping /proc/mounts, therefore never finishing its
> job.
Add set -e back, and does changing this line:
to either
mountsent=
or
mountsent=
work as well?
Thanks for testing.
--=20
Joshua Kwan
--z6Eq5LdranGa6ru8
Content-Type: application/
Content-
Content-
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: http://
iQIVAwUBQXC47KO
KyBCp2IkzFvERKX
2ULlY3Ma2/
0qVb/hPwM5NhG+
kEar86S3QpqngW+
KFbhV2i81Pmzd+
VrkrNbMod+
QZd3DLjnX409Vs4
qLsLhabC9xmBWdY
c8RZAqma/
NCll3zKKBHB6rdb
gzky//zGoCk=
=4iRh
-----END PGP SIGNATURE-----
--z6Eq5LdranGa6
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Debian Bug Importer (debzilla) wrote : | #10 |
Message-ID: <email address hidden>
Date: Sat, 16 Oct 2004 15:23:05 +0100
From: Colin Watson <email address hidden>
To: Joshua Kwan <email address hidden>, <email address hidden>
Cc: Farzad FARID <email address hidden>
Subject: Re: Bug#276722: discover1: "set -e" prevents cdrom mountpoint creation
On Fri, Oct 15, 2004 at 11:00:13PM -0700, Joshua Kwan wrote:
> On Fri, Oct 15, 2004 at 11:56:16PM +0200, Farzad FARID wrote:
> > On my freshly installed Debian unstable, /etc/init.
> > create the symlinks in /dev and /media. I trace this down with "sh -x
> > /etc/init.
> > an error while grepping /proc/mounts, therefore never finishing its
> > job.
>
> Add set -e back, and does changing this line:
>
> mountsent="$(grep " $CDMOUNT " /proc/mounts)"
>
> to either
>
> mountsent=$(grep " $CDMOUNT " /proc/mounts)
>
> or
>
> mountsent=$(grep " $CDMOUNT " /proc/mounts || true)
In either case, removing quoting is surely the wrong answer. I'd do one
of these:
mountsent="$(grep " $CDMOUNT " /proc/mounts || true)"
mountsent="$(grep " $CDMOUNT " /proc/mounts)" || true
--
Colin Watson [<email address hidden>]
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Debian Bug Importer (debzilla) wrote : | #11 |
Message-ID: <email address hidden>
Date: Sat, 16 Oct 2004 16:58:36 +0200
From: Farzad FARID <email address hidden>
To: Colin Watson <email address hidden>, Joshua Kwan <email address hidden>, <email address hidden>
Subject: Re: Bug#276722: discover1: "set -e" prevents cdrom mountpoint creation
on 16.10.2004 16:23 Colin Watson said the following:
>In either case, removing quoting is surely the wrong answer. I'd do one
>of these:
>
> mountsent="$(grep " $CDMOUNT " /proc/mounts || true)"
> mountsent="$(grep " $CDMOUNT " /proc/mounts)" || true
>
>
>
Both these solutions correct the problem. I let you choose the one you
prefer :)
Regards
--
Farzad FARID <email address hidden> http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Debian Bug Importer (debzilla) wrote : | #12 |
Message-ID: <email address hidden>
Date: Sat, 16 Oct 2004 09:11:48 -0700
From: <email address hidden> (Joshua Kwan)
To: Colin Watson <email address hidden>
Cc: <email address hidden>, Farzad FARID <email address hidden>
Subject: Re: Bug#276722: discover1: "set -e" prevents cdrom mountpoint creation
On Sat, Oct 16, 2004 at 03:23:05PM +0100, Colin Watson wrote:
> In either case, removing quoting is surely the wrong answer. I'd do one
> of these:
>
> mountsent="$(grep " $CDMOUNT " /proc/mounts || true)"
> mountsent="$(grep " $CDMOUNT " /proc/mounts)" || true
I was under the impression that quoting wasn't required for $(...)
constructs, and that having the duplicate double quotes in the middle
would render void the intentional whitespace.
Are you sure this isn't breaking more than it fixes? :)
--
Joshua Kwan
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Debian Bug Importer (debzilla) wrote : | #13 |
Message-ID: <email address hidden>
Date: Sat, 16 Oct 2004 22:02:30 +0100
From: Colin Watson <email address hidden>
To: Joshua Kwan <email address hidden>
Cc: <email address hidden>, Farzad FARID <email address hidden>
Subject: Re: Bug#276722: discover1: "set -e" prevents cdrom mountpoint creation
On Sat, Oct 16, 2004 at 09:11:48AM -0700, Joshua Kwan wrote:
> On Sat, Oct 16, 2004 at 03:23:05PM +0100, Colin Watson wrote:
> > In either case, removing quoting is surely the wrong answer. I'd do one
> > of these:
> >
> > mountsent="$(grep " $CDMOUNT " /proc/mounts || true)"
> > mountsent="$(grep " $CDMOUNT " /proc/mounts)" || true
>
> I was under the impression that quoting wasn't required for $(...)
> constructs,
Quoting's always good style in shell. As it happens, you get away
without it here because word splitting and pathname expansion are not
performed on the value in a name=value assignment, and those are the
only two expansions that happen after command substitution. All the
same, it promotes better practice to quote everywhere unless there's an
actively good reason not to do so.
> and that having the duplicate double quotes in the middle would render
> void the intentional whitespace.
No, shell quoting rules mean that the initial " doesn't get closed until
the $() is closed. Try it:
$ foo="$(echo " hello " " world ")"
$ echo "$foo"
hello world
> Are you sure this isn't breaking more than it fixes? :)
I always put double quotes around $(). Besides, you're the one
suggesting a change. :-)
Cheers,
--
Colin Watson [<email address hidden>]
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Debian Bug Importer (debzilla) wrote : | #14 |
Message-ID: <email address hidden>
Date: Sun, 17 Oct 2004 14:28:13 +0300
From: "AKL. Mantas Kriauciunas" <email address hidden>
To: <email address hidden>
Subject: severity 276722 critical
severity 276722 critical
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel Stone (daniels) wrote : | #15 |
I don't think this is applicable to us -- we use udev instead, yeah, Colin?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Colin Watson (cjwatson) wrote : | #16 |
Right, and we've disabled the discover1 init script anyway as I recall (though
check that, my memory's unreliable).
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel Stone (daniels) wrote : | #17 |
Thanks dude.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
|
#18 |
Hi,
I've set severity of this bug to critical, because this makes CD drive
unaccesible for lots of people. discover1 could go into sarge only when
this bug will be fixed.
--
Good luck,
Mantas Kriaučiūnas <email address hidden> Jabber ID: <email address hidden>
Public organization "Open Source for Lithuania" - www.akl.lt
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Debian Bug Importer (debzilla) wrote : | #19 |
Message-ID: <email address hidden>
Date: Sun, 17 Oct 2004 22:53:49 +0300
From: "AKL. Mantas Kriauciunas" <email address hidden>
To: <email address hidden>
Subject: discover1 1.7.2 shouldn't go into Sarge
Hi,
I've set severity of this bug to critical, because this makes CD drive
unaccesible for lots of people. discover1 could go into sarge only when
this bug will be fixed.
--=20
Good luck,
Mantas Kriau=C4=
t
Public organization "Open Source for Lithuania" - www.akl.lt
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
|
#20 |
# Automatically generated email from bts, devscripts version 2.8.5
package discover1 discover1 libdiscover1 libdiscover1-dev libdiscover1-pic discover1-udeb
tags 276474 + pending
tags 276475 + pending
tags 276722 + pending
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Debian Bug Importer (debzilla) wrote : | #21 |
Message-Id: <E1CJIrJ-
Date: Sun, 17 Oct 2004 14:46:33 -0700
From: Joshua Kwan <email address hidden>
To: <email address hidden>
Subject: setting package to discover1 discover1 libdiscover1 libdiscover1-dev libdiscover1-pic
discover1-udeb ... ... ...
# Automatically generated email from bts, devscripts version 2.8.5
package discover1 discover1 libdiscover1 libdiscover1-dev libdiscover1-pic discover1-udeb
tags 276474 + pending
tags 276475 + pending
tags 276722 + pending
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
|
#22 |
Source: discover1
Source-Version: 1.7.3
We believe that the bug you reported is fixed in the latest version of
discover1, which is due to be installed in the Debian FTP archive:
discover1-
to pool/main/
discover1_1.7.3.dsc
to pool/main/
discover1_
to pool/main/
discover1_
to pool/main/
libdiscover1-
to pool/main/
libdiscover1-
to pool/main/
libdiscover1_
to pool/main/
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Joshua Kwan <email address hidden> (supplier of updated discover1 package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Sun, 17 Oct 2004 14:25:35 -0700
Source: discover1
Binary: libdiscover1 discover1 libdiscover1-pic discover1-udeb libdiscover1-dev
Architecture: source i386
Version: 1.7.3
Distribution: unstable
Urgency: high
Maintainer: Debian Install System Team <email address hidden>
Changed-By: Joshua Kwan <email address hidden>
Description:
discover1 - hardware identification system
discover1-udeb - hardware identification library (udeb) (udeb)
libdiscover1 - hardware identification library
libdiscover1-dev - hardware identification library development files
libdiscover1-pic - hardware identification library - static PIC version
Closes: 276474 276475 276722
Changes:
discover1 (1.7.3) unstable; urgency=high
.
* Joshua Kwan
- Apply Thomas Hood's patch to use run-parts in /etc/discover.d.
closes: #276475
- Add Depends on discover1-data for discover1. closes: #276474
- Add || true to mountsent variable assignment from grep. Oops.
closes: #276722
Files:
08cc056936e5a7
90745819c95f37
8e0dff29fa17ef
b080c475bb3a9f
ab66c7766fe584
20e0f556c7c891
eb9b90a5c15ccc
package-type: udeb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: http://
iQIVAwUBQXc/
FCfoZJ9...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Debian Bug Importer (debzilla) wrote : | #23 |
Message-Id: <email address hidden>
Date: Thu, 21 Oct 2004 01:02:05 -0400
From: Joshua Kwan <email address hidden>
To: <email address hidden>
Subject: Bug#276722: fixed in discover1 1.7.3
Source: discover1
Source-Version: 1.7.3
We believe that the bug you reported is fixed in the latest version of
discover1, which is due to be installed in the Debian FTP archive:
discover1-
to pool/main/
discover1_1.7.3.dsc
to pool/main/
discover1_
to pool/main/
discover1_
to pool/main/
libdiscover1-
to pool/main/
libdiscover1-
to pool/main/
libdiscover1_
to pool/main/
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Joshua Kwan <email address hidden> (supplier of updated discover1 package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Sun, 17 Oct 2004 14:25:35 -0700
Source: discover1
Binary: libdiscover1 discover1 libdiscover1-pic discover1-udeb libdiscover1-dev
Architecture: source i386
Version: 1.7.3
Distribution: unstable
Urgency: high
Maintainer: Debian Install System Team <email address hidden>
Changed-By: Joshua Kwan <email address hidden>
Description:
discover1 - hardware identification system
discover1-udeb - hardware identification library (udeb) (udeb)
libdiscover1 - hardware identification library
libdiscover1-dev - hardware identification library development files
libdiscover1-pic - hardware identification library - static PIC version
Closes: 276474 276475 276722
Changes:
discover1 (1.7.3) unstable; urgency=high
.
* Joshua Kwan
- Apply Thomas Hood's patch to use run-parts in /etc/discover.d.
closes: #276475
- Add Depends on discover1-data for discover1. closes: #276474
- Add || true to mountsent variable assignment from grep. Oops.
closes: #276722
Files:
08cc056936e5a7
90745819c95f37
8e0dff29fa17ef
b080c475bb3a9f
ab66c7766fe584
20e0f556c7c891
eb9b90a5c15ccc
...
Changed in discover1: | |
status: | Unknown → Fix Released |
On Fri, Oct 15, 2004 at 11:56:16PM +0200, Farzad FARID wrote: d/discover fails to d/discover start" and found out that the script stopped on
> On my freshly installed Debian unstable, /etc/init.
> create the symlinks in /dev and /media. I trace this down with "sh -x
> /etc/init.
> an error while grepping /proc/mounts, therefore never finishing its
> job.
Add set -e back, and does changing this line:
to either
mountsent=$(grep " $CDMOUNT " /proc/mounts)
or
mountsent=$(grep " $CDMOUNT " /proc/mounts || true)
work as well?
Thanks for testing.
--
Joshua Kwan