Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 569820 - xfce-extra/xfce4-sensors-plugin-1.2.6 automagically depends on running hddtemp
Summary: xfce-extra/xfce4-sensors-plugin-1.2.6 automagically depends on running hddtemp
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: XFCE Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-26 16:08 UTC by smithpa57
Modified: 2018-05-11 11:48 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_569820.txt,4.76 KB, text/plain)
2015-12-26 16:08 UTC, smithpa57
Details

Note You need to log in before you can comment on or make changes to this bug.
Description smithpa57 2015-12-26 16:08:22 UTC
Created attachment 420886 [details]
emerge --info

When using the __Gentoo emerge process__ of:
xfce-extra/xfce4-sensors-plugin-1.2.6::gentoo  USE="acpi hddtemp libnotify lm_sensors -debug"

The resulting binary plugin insists on trying to exec 'hddtemp', which requires root privileges, instead of using netcat to read from the hddtemp daemon.

A properly setup system is:
(root) rc-config add hddtemp default
(root) /etc/init.d/hddtemp start
(non root user) netcat localhost 7634
(sample output) |/dev/sda|ST3200822AS|31|C||/dev/sdb|Generic USB SD Reader|NA|*|

When the plugin is built from the sources:
/usr/portage/distfiles/xfce4-sensors-plugin-1.2.6.tar.bz2

With: ./configure, make, make install

Results:  /usr/bin/netcat is detected and is used, #ifdef NETCAT is 1 in the sources, resulting in correct non-root-user operation.

Conclusion:  The cryptic ebuild lines '(hddtemp) (hddtemp netcat)' are resulting in #ifdef NETCAT 0 for unknown reasons.  The EBUILD creates an incorrect build config that  ./configure from the same source does not have.

Why this has never been fixed:
Poor workarounds for this bug are easily found on stackexchange, etc., such as 'chmod u+s hddtemp' for Arch Linux, etc.  The goal is not to spawn hddtemp as a non-root user frequently.  The /etc/init.d/hddtemp is designed to provide the information correctly to non-root users.

Obligatory emerge --info attahced, but irrelevant
Comment 1 Alex Xu (Hello71) 2015-12-27 17:02:40 UTC
netcat is not used if hddtemp daemon is not running at time of build, even if --enable-netcat is specified.

this has got to be one of the dumbest ideas I've ever seen.
Comment 2 smithpa57 2015-12-28 03:54:24 UTC
(In reply to Alex Xu (Hello71) from comment #1)
> netcat is not used if hddtemp daemon is not running at time of build, even
> if --enable-netcat is specified.
> 
> this has got to be one of the dumbest ideas I've ever seen.

The bug report gives sample output of netcat reading a line of "netcat/hddtemp" (as a non-root-user) temperature data from the hddtemp daemon showing the temperature of /dev/sda and /dev/sdb AT THE VERY TIME that the xfce-plugin is throwing up dialog boxes that a non-root-user cannot spawn hddtemp.  Please re-read the bug report, it is the ebuild that is breaking the test (hddtemp netcat) --> "ifdef NETCAT 0" IN C SOURCE CODE".
Comment 3 smithpa57 2015-12-28 09:31:14 UTC
Sorry, I didn't understand Alex Hu's comment, I thought it was directed at the bug report and not at the ./configure script of upstream.  Examining config.log we see the upstream problem:

configure:13568: checking for netcat path
configure:13575: result: /usr/bin/netcat
configure:13584: checking for hddtemp being queryable via netcat
configure:13587: result: |/dev/sda|ST3200822AS|30|C||/dev/sdb|Generic

The builds work correctly if 'emerge hddtemp' and '/etc/init.d/hddtemp start' have already been run before 'USE=hddtemp emerge xfce4-sensors-plugin' (or ./configure; make; make install for that matter).

In the hddtemp ebuild (src_install()) we see:
  newinitd "${FILESDIR}"/hddtemp-init hddtemp
  systemd_install_serviced "${FILESDIR}"/hddtemp.service.conf

If there isn't a better solution, printing a message at the end of the  xfce4-sensors-plugin build would be a workaround:

"The package author intended that hddtemp is installed and the hddtemp service is started before building "xfce4-sensors-plugin (USE=hddtemp)".  If you experience problems with the sensors plugin reading disk temperatures  (especially as a non-root user) please start the hddtemp service and then rebuild xfce4-sensors-plugin, then restart xfce."
Comment 4 Göktürk Yüksek archtester gentoo-dev 2017-03-27 02:05:08 UTC
Note that this would fail even with hddtemp running if you have FEATURES='network-sandbox'.
Comment 5 Göktürk Yüksek archtester gentoo-dev 2017-03-27 21:05:22 UTC
This is now fixed in upstream: https://github.com/xfce-mirror/xfce4-sensors-plugin/commit/1fe2ce36aa0a363b02102d8f487d7c5dfa9e9b3c