#859388 blkdeactivate: /bin/sort: No such file or directory

Package:
dmsetup
Source:
lvm2
Description:
Linux Kernel Device Mapper userspace library
Submitter:
Kevin Locke
Date:
2021-09-15 13:30:06 UTC
Severity:
important
Tags:
#859388#5
Date:
2017-04-03 03:37:23 UTC
From:
To:
Dear Maintainer,

When executed with any arguments, the blkdeactivate script fails with
the following output:

Deactivating block devices:
/sbin/blkdeactivate: line 320: /bin/sort: No such file or directory

This occurs because Debian ships sort as /usr/bin/sort instead of
/bin/sort.  The fix is simply to change or remove the path.  The
attached patch removes the path, since I can't see any risk as the
script only uses options defined by POSIX.

Thanks,
Kevin

#859388#10
Date:
2018-04-07 12:38:29 UTC
From:
To:
I'm seeing this logged to the journal/syslog by default on shutdown
under an up to date sid install.

#859388#15
Date:
2018-04-12 08:39:53 UTC
From:
To:

*** /tmp/tmpqyjXGq/bug_body

In Ubuntu, the attached patch was applied to achieve the following:

  * scripts/blkdeactivate.sh.in: Refer to /usr/bin/sort, not /bin/sort


Thanks for considering the patch.

#859388#20
Date:
2019-10-12 15:26:20 UTC
From:
To:
Oct 12 14:53:49 tuesday blkdeactivate[5119]: Deactivating block devices:
Oct 12 14:53:49 tuesday blkdeactivate[5119]: /sbin/blkdeactivate: line 345: /bin/sort: No such file or directory

16:22:36 0$ grep sort /sbin/blkdeactivate
SORT_MNT="/bin/sort -r -u -k 4"
16:24:07 0$ ls -l /bin/sort /usr/bin/sort
ls: cannot access '/bin/sort': No such file or directory
-rwxr-xr-x 1 root root 114120 Feb 28  2019 /usr/bin/sort

#859388#27
Date:
2019-12-27 13:08:11 UTC
From:
To:
severity 859388 important
thanks
path, as in the patch below. Hardcoding a path defeats the purpose of
having a PATH and a search algorithm for commands.

(I would be surprised if this is not already Debian Policy)

While we are at it, I believe this is the kind of bug that we should
also try to fix in stable as well, so I'm raising it to "important".

Note: Not everybody will notice this because of the usr-merge thing,
but I can reproduce this on brand new GCE buster instances because
official GCE images do not use usr-merge at this moment.

Thanks.
--- a/scripts/blkdeactivate.sh.in
+++ b/scripts/blkdeactivate.sh.in
@@ -58,7 +58,7 @@ MPATHD_OPTS=""
 LSBLK="/bin/lsblk -r --noheadings -o TYPE,KNAME,NAME,MOUNTPOINT"
 LSBLK_VARS="local devtype local kname local name local mnt"
 LSBLK_READ="read -r devtype kname name mnt"
-SORT_MNT="/bin/sort -r -u -k 4"
+SORT_MNT="sort -r -u -k 4"

 # Do not show tool errors by default (only done/skipping summary
 # message provided by this script) and no verbose mode by default.

#859388#32
Date:
2020-07-26 05:21:38 UTC
From:
To:
I've prepared a NMU fixing these long-standing bugs with patches. Thanks
to all the contributors. I've uploaded it to delayed/15. Please let me
know if I should defer it any longer. I'm attaching a .debdiff of the
proposed changes.

Helmut

#859388#39
Date:
2020-07-26 09:22:35 UTC
From:
To:
Control: tags -1 - pending

Don't.  At least in this form.

.gitignore is git metadata.  How does this relate to anything?

Needed by python packages.

Err, no hacks in dependencies.

No.

Bastian

#859388#46
Date:
2020-07-31 15:06:48 UTC
From:
To:
Cancelled.

I have no clue. The .gitignore gets deleted by dpkg-source. I have no
clue why it does that nor how to make it stop. If lvm2 does not work
with dpkg-source, then most likely, it's a bug in lvm2. I considered
this a minor nuisance easily reverted with the next MU that is properly
tracked in git.

I know. Why do you tell me?

Please point out what the hack is. This is a standard approach for
having a version-locked dependency from an arch:all on an arch:any
package. No hack involved.

There now is a simpler way to achive the same:

Build-Depends: debhelper-compat (= 13)
Build-Depends-Indep: dh-sequence-python3

Does that work any better?

Helmut

#859388#53
Date:
2021-09-15 12:58:06 UTC
From:
To:
control: fixed -1 2.03.11-2.1

It looks like bug #946882 was a duplicate of this one. Marking as fixed
and leaving it for the maintainer to mark as done when he sees fit.