Package: util-linux
Version: 2.38-4+exp2
Severity: normal
X-Debbugs-Cc: [email protected]
Dear Maintainer,
a monitoring script that uses "lsblk -JO" fails, because the produced
json output is invalid.
a shorter output "lsblk -J -o zone-app" (just an example field, others are also
affected)
also produces invalid json:
~~~
lsblk -J -o zone-app /dev/dm-0
{
"blockdevices": [
{
"zone-app": 0B
},{
"zone-app": 0B
},{
"zone-app": 0B
},{
"zone-app": 0B
},{
"zone-app": 0B
},{
"zone-app": 0B
},{
"zone-app": 0B
},{
"zone-app": 0B
},{
"zone-app": 0B
},{
"zone-app": 0B
}
]
}
~~~
Other Fields put the 0B into quotation marks
~~~
lsblk -JO|grep -Eo '["][^"]*["][:].*0B.*[,]'|sort -u
"disc-gran": "0B",
"disc-max": "0B",
"wsame": "0B",
"zone-app": 0B,
"zone-sz": 0B,
"zone-wgran": 0B,
~~~
fields
disc-gran, disc-max and wssam do quote,
zone-ap, zone-sz and zone-wgran do not quote.
as a test "json_pp" from the package "perl"
"lsblk -JO|json_pp" prints an error message
-- System Information:
Debian Release: bookworm/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 5.16.0-5-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages util-linux depends on:
ii libblkid1 2.38-4
ii libc6 2.33-7
ii libcap-ng0 0.8.3-1
ii libcrypt1 1:4.4.28-1
ii libmount1 2.38-4
ii libpam0g 1.4.0-13
ii libselinux1 3.4-1
ii libsmartcols1 2.38-4
ii libsystemd0 251.2-7
ii libtinfo6 6.3+20220423-2
ii libudev1 251.2-7
ii libuuid1 2.38-4
ii util-linux-extra 2.38-4
ii zlib1g 1:1.2.11.dfsg-4
util-linux recommends no packages.
Versions of packages util-linux suggests:
ii dosfstools 4.2-1
ii kbd 2.3.0-3
ii util-linux-locales 2.38-4
-- no debconf information