dockapps/wmhdplop
Doug Torrance 8c43b61e0d wmhdplop: Find disk device after /run transition
Patch by Andre Beck <beck@ibh.de> to fix Debian bug #657882.

After the recent /run transition, which also finally turned /etc/mtab into
a symlink to /proc/mounts, *hdplop (both incarnations) may fail to find a
single disk device automatically. This is likely due to the root device
now being exposed as mounted on /dev/disk/by-uuid/$UUID whereas the
former /etc/mtab as written by mount still contained a device name as
taken from /etc/fstab, which in my case could be parsed by *hdplop. It's
unclear if this wouldn't have hit other environments earlier depending
on their fstab contents, I just assume for now that I'm one of the
remaining handful of users of this tool ;)

The fundamental issue is of course the rather crude code in devnames.c's
device_id_from_name() which tries to manually resolve device symlinks,
but cannot possibly work with any symlink except those located directly
in /dev - symlinks in subdirectories of /dev will fail.

Impact on wmhdplop: Doesn't start except when called explicitely with
some "-d /dev/sda" or such option.

Impact on gkrellm-hdplop: Starts but is dazed and confused, leaving a
black window in gkrellm. Clicking on the black window will then crash
gkrellm, as it hits an assertion that the device list cannot be empty.

I've prepared a small patch that makes *hdplop work again for me, the
patch replaces the broken manual symlink resolving by a simple call
to realpath(3), hopefully not breaking other stuff. I refrained from
doing any more changes to the code, even though it looks like it needs
some love. Upstream seems to have lost interest five years ago, though...

So, without much further ado, here's my crude fix:

Don't look too closely, specifically on the strncpy(3) stuff, but I felt
this is still better than abusing snprintf(3) like the original code does
some lines above, and as I said, starting to really fix things here looks
like a bottomless pit...

Thanks,
Andre.

https://bugs.debian.org/657882
https://sources.debian.net/src/wmhdplop/0.9.9-5/debian/patches/
  find-disk-device.patch/
2016-11-24 15:43:12 +00:00
..
AUTHORS wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
autogen.sh wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
ChangeLog wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
configure.ac wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
COPYING wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
devnames.c wmhdplop: Find disk device after /run transition 2016-11-24 15:43:12 +00:00
devnames.h wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
dockapp_imlib2.c wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
dockapp_imlib2.h wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
gkrellm_hdplop.c wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
global.h wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
Makefile.am wmhdplop: Change gkhdplop_so_LDFLAGS to gkhdplop_so_LDADD in Makefile 2016-11-24 15:43:12 +00:00
NEWS wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
procstat.c wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
procstat.h wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
README wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
util.c wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
util.h wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
wmhdplop.c wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00
wmhdplop.h wmhdplop: Add version 0.9.9 to repository. 2016-11-24 15:42:29 +00:00

          ------------------------------------------------
                        wmdhplop & gkhdplop
          ------------------------------------------------

  wmhdplop is yet another monitoring applet. This one watches hard-drive 
activity.
  gkhdplop is the port of wmhdplop into a gkrellm2 plugin.

Compilation:
-----------
  ./configure && make && make install

  Note that this applet uses Imlib2, and requires the script imlib2-config 
to be in the path. It won't compile on anything but a recent linux kernel
(2.4.20 or better, 2.6 is also supported).

  gkhdplop requires gtk2 and gkrellm2.
  
Usage:
------
  wmhdplop -h for the list of options. If you have the hddtemp daemon running,
then wmhdplop may use it to display the temperature of your hard-drives.
  The monitored hard-drive or partition can be changed with the mouse wheel.

gkhdplop:
---------
  To install the plugin:
    mv gkhdplop.so ~/.gkrellm2/plugins
  
  The configuration is made by clicking with the right button on the plugin.
  BUG: gkhdplop will close gkrellm if no default .ttf font is found (look at
  the messages in console).