ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
62 stars 58 forks source link

ap-check system binary can't be in /etc #139

Closed sharkcz closed 1 year ago

sharkcz commented 2 years ago

With the introduction of the ap-check utility we have a problem that it is installed under /etc/mdevctl.d/, which is wrong. /etc is a place to store local modification of a system configuration. I see mdevctl doesn't currently offer a system-wide location, but it should be fixed for the future. The proper place could be /usr/lib/mdevctl/... similar to what udev or systemd use for their system-wide stuff.

sharkcz commented 2 years ago

I have opened https://github.com/mdevctl/mdevctl/issues/63 for upstream discussion.

rosatomj commented 2 years ago

Thanks Dan -- AFAIU /etc/mdevctl.d/scripts.d/callouts/ is currently the only place mdevctl will look for these utility scripts; let's see first where the mdevctl discussion goes (thanks for opening this already) and what change they will make, then we can adjust ap-check installation accordingly.

hoeppnerj commented 1 year ago

Even though I've closed the issue as duplicate, @frank-heimes suggested a wrapper as a short-term solution: See https://github.com/ibm-s390-linux/s390-tools/issues/143

A workaround (that I use for now) is to move the 'ap-check' binary within the build tree to /usr/lib/s390-tools/ - where other binaries files already reside, and instead place a wrapper with the same name at /etc/mdevctl.d/scripts.d/callouts/' that looks like this: --------%<----------------%<----------------%<----------------%<-------- --- /dev/null +++ b/etc/mdevctl.d/scripts.d/callouts/ap-check.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# wrapper script for 'ap-check' binary, to avoid lintian error 'binary-in-etc' + +[ -e /usr/lib/s390-tools/ap-check ] && /usr/lib/s390-tools/ap-check "$@" --------%<----------------%<----------------%<----------------%<--------

Since I'm doing this partially with the help of debian helper (package management) files (debian/rules and debian/s390-tools.install), I unfortunately have no PR that could be directly picked up.

Putting it in here so it doesn't get lost as it might be worth considering. Thoughts @rosatomj ?

rosatomj commented 1 year ago

Sounds like that approach works to solve Frank's issue (and FWIW I did also test Frank's approach against automated tests just now and it seems to work fine). Maybe it's a possible workaround here too to at least get the binary out of etc but I don't think it addresses Dan's core concern of "/etc is a place to store local modification of a system configuration" -- The only way to address that is with an mdevctl change to look elsewhere for callout scripts, and then s390-tools can either install a wrapper at that location or the binary itself.