Bug#1011525: systemd: when running journalctl, $LESS is unconditionally set to FRSXMK

Michael Biebl biebl at debian.org
Wed May 25 14:13:58 BST 2022


Am 25.05.22 um 14:51 schrieb Vincent Lefevre:
> Control: reopen -1
> 
> On 2022-05-25 13:28:31 +0200, Michael Biebl wrote:
>> Am 24.05.22 um 15:23 schrieb Vincent Lefevre:
>>> Package: systemd
>>> Version: 251-2
>>> Severity: minor
>>>
>>> Note: on my machine, /usr/bin/pager points to the "less" alternative.
>>>
>>> When I run journalctl, searching for strings in the "less" pager is
>>> case-sensitive, while I have -i in $LESS.
>>>
>>> I've eventually found that my LESS environment variable was replaced
>>> by "FRSXMK", but this is not documented.
>>
>> This is documented here:
>> https://www.freedesktop.org/software/systemd/man/journalctl.html#%24SYSTEMD_LESS
> 
> There is no mention of the LESS environment variable there.
> As I read "options passed to less", this consists in running
> "less -FRSXMK" (this is the usual way options are passed to
> programs and has the advantage to honor some options of the
> user's LESS environment variable, like "-i"). If it passes
> options via the LESS environment variable, then the manual
> should say something like

It doesn't pass the LESS environment variable that's defined in the user 
session to the pager but runs that program in a defined, fixed and 
tested environment.

Internally it uses the LESS environment variable to pass those options 
to less.

See
https://github.com/systemd/systemd/blob/main/src/shared/pager.c#L132
https://github.com/systemd/systemd/blob/main/src/shared/pager.c#L158


It's basically the same with systemctl, where the environment of the 
user executing the command does not leak into the environment of the 
service (say PATH).

This is by design I'd say.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20220525/b6b5af3f/attachment-0001.sig>


More information about the Pkg-systemd-maintainers mailing list