Bug#837218: lv: breaks systemctl display status

Osamu Aoki osamu at debian.org
Sun Sep 25 14:09:54 BST 2016


Hi,

There are many ways to address one issue but that fix should not cause
other undesirable/hidden side effects.  Minimum change and least
surprise should be the guiding principle. 

On Thu, Sep 22, 2016 at 02:55:41PM +0900, Hideki Yamane wrote:
> Hi,
> 
>  Other solution from some people.

One another way is to talk to the upstream and change the default
behavior of "lv" from "-a" to "-c".  I am not promoting this idea
strongly since this breaks the backward compatibility.  This should only
be done if the upstream strongly believes in this change of the "lv"
default behavior and he is willing to take its responsibility.

(Doing the same as a Debian patch is not worth it since it creates
additional challenge to the Debian maintainer.)

>  Kenshi Muto suggests set "LV=-c" to /etc/profile.d/somefile and bash can
>  read such setting.

Technically this address pager problem for most cases but now you need
to use "-a" to get the upstream expected default behavior.  For
unsuspecting users of "lv" command, that is effectively the same as
changing the default behavior of the original upstream code.  Thus, this
is practically the same as changing upstream code as a Debian patch.

If you dare to take this path, you must document such situation in the
/usr/share/doc/lv/README.Debian file explicitly.  But please don't do
this behind users as a part of packaging.

I agree to the suggestion if it is provided as a part of the document in
/usr/share/doc/lv/README.Debian describing the customization of the "lv"
behavior.  Please suggest it there also with ~/.profile.d/somefile too.

>  Yoshihito Yoshino suggests set systemd to detect lv and set in it as
>  git does as below (pager.c file).
> 
> > void prepare_pager_args(struct child_process *pager_process, const char *pager)
> > {
> >         argv_array_push(&pager_process->args, pager);
> >         pager_process->use_shell = 1;
> >         if (!getenv("LESS"))
> >                 argv_array_push(&pager_process->env_array, "LESS=FRX");
> >         if (!getenv("LV"))
> >                 argv_array_push(&pager_process->env_array, "LV=-c");
> > }

Technically this address the pager problem, too.  But this faces the same
problem as above.  (I may be wrong here but, unlike the git case,
exporting environment variables to systemd seems to change the value of
those environment variables for all the child process including ones not
intended such as shell prompt inputs.  If such concern is addressed,
this may be a valid way.  But quite frankly, this kind of complexity is
not a good idea unless the upstream is willing to maintain it.)

So the correct thing to do is to demote the preference of "lv" to "55"
and add "lv/README.Debian" file describing tricks for the environment
variables to use the "lv" command acress the system when the user
intentionally chose the "lv" after reading lv/README.Debian.

Regards,

Osamu 



More information about the Pkg-systemd-maintainers mailing list