Battery info returns: sh: 0: -c requires an argument

Bug #1308853 reported by Ted Cox
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
hardinfo (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

The command under Procedure B for generating a pasetebin link hardware profile doesn't work.

⟫ hardinfo -ram devices.so 2>&1
Computer
 Summary
sh: 1: /lib/libc.so.6: not found
sh: 1: gnome-about: not found
 Operating System
 Kernel Modules
 Boots
 Languages
 Filesystems
 Display
 Environment Variables
 Users
Devices
 Processor
 Memory
 PCI Devices
 USB Devices
 Printers
 Battery
sh: 0: -c requires an argument
 Sensors
 Input Devices
 Storage
 DMI
 Resources

Revision history for this message
Ted Cox (ted-m-cox) wrote :
affects: ubuntu-qa-website → hardinfo (Ubuntu)
description: updated
summary: - Command to generate pastebin link doesn't work
+ Battery info returns: sh: 0: -c requires an argument
Revision history for this message
Phill Whiteside (phillw) wrote :

I didn't write the script, I only host them :)

I'll ask if a script kiddie can have a look into it.

 I've manually copied the data over.

Regards,

Phill.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Confirmed. Also, the command above doesn't run copy to pastebin, etc. The problem is with hardinfo itself..

That said, I'm not sure this is really a bug / critical bug. My machine doesn't have a battery and the report generates just fine without it.

Changed in hardinfo (Ubuntu):
status: New → Incomplete
Revision history for this message
Phill Whiteside (phillw) wrote :

balloons no it does not...
 Battery
sh: 0: -c requires an argument
 Sensors
 Input Devices
 Storage
 DMI
 Resources
phillw@piglet:~/Desktop/ISOs$

No link number

Revision history for this message
Phill Whiteside (phillw) wrote :

nicholas I'm confirming this with https://bugs.launchpad.net/ubuntu/+source/hardinfo/+bug/1313988 you are the bug people... .. I did try to ask if it was hardinfo or pastebin. In any case, no more profiles will be accepted to the database until it is resolved ...So, feel free to make it what ever priority you see fit. As for me, I'd rather people be able to post up their machine specifications just on the off chance it helps a dev not have to ask... After all, this is why it is on the iso-tracker etc.

Changed in hardinfo (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Jonathan Marsden (jmarsden) wrote :

(1) Lack of the link URL is not caused by these error messages in hardinfo's output. Neither pastebinit nor clipit care what text you provide them as input. See whether something as simple as

  date |pastebinit |clipit -c

works for you.

(2) The bug generating the unwanted output "sh: 0: -c requires an argument" is in the source file arch/linux/common/battery.h in the function __scan_battery_apcupsd .

Since Ubuntu bugs generally don't care whether you are using an APC UPS or not, one workaround is to comment out the call to that function on line 283 of the file and rebuild the hardinfo package. My suspicion is that someething bad is happening the code around line 58 to 60 of the file, so it is trying to popen apcaccess when it does not exist, and the shell used by popen is then complaining that you didn't give it a command to execute.

As further confirmation, if you install apcupsd but dont bother configuraing it, and then run hardinfo -ram devices.so again, you get a different error about apcupsd.

(3) The error earlier in the output about gnome-about is because gnome-about is not installed... and the code dealing with that is in arch/linux/common/os.h in function detect_desktop_environment. I see that code uses GNOME_DESKTOP_SESSION_ID which on my Ubuntu 14.04 machine is currently set to "this-is-deprecated". Around line 95 or so.

(4) The error about libc.so.6 is because that file is no longer at /lib/libc.so.6 due to multiarch, it is now at /lib/x86_64-linux-gnu/libc.so.6 or similar. So the code at line 55 or so of arch/linux/common/os.h in function get_libc_version is now in need of rework.

I don't have time to dive into this and provide a real fix, I'm afaid, but that should be a good start for anyone with more available time than I have to investigate these errors further.

HOWEVER, note carefully that these hardinfo issues are *not* in themselves preventing pastebinit or clipit from generating hardware profiles on a pastebin site. See http://pastebin.com/UwR4cWkZ which I just created with the Ubuntu 14.04 hardinfo.

Whatever is breaking pastebin for phillw is some other issue entirely, not a hardinfo problem. Testing with a different text-generating program at the start of the pipeline, such as date, or even ls, will help to confirm this.

Jonathan

Revision history for this message
Pander (pander) wrote :
Revision history for this message
Simon Quigley (tsimonq2) wrote :

I cannot confirm this on a Bionic install.

Changed in hardinfo (Ubuntu):
status: Confirmed → Incomplete
Pander (pander)
tags: added: 18.04
tags: added: bionic
removed: 18.04
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.