GNU bug report logs - #77220
[shepherd]: Timers do not set HOME environment variable correctly

Previous Next

Package: guix;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Sun, 23 Mar 2025 21:31:01 UTC

Severity: normal

Done: Tomas Volf <~@wolfsden.cz>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 77220 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tomas Volf <~@wolfsden.cz>
Cc: 77220 <at> debbugs.gnu.org
Subject: Re: bug#77220: [shepherd]: Timers do not set HOME environment
 variable correctly
Date: Tue, 01 Apr 2025 12:18:19 +0200
Hi Tomas,

Tomas Volf <~@wolfsden.cz> skribis:

> In case anyone runs into this bug, below is a full version I ended up
> using (user, group, environment-variables are arguments to the wrapping
> function).
>
> #:user #$user
> #:group #$group
> #:environment-variables
> (let ((pw (getpw (or #$user (getuid)))))
>   (cons* (string-append "HOME=" (passwd:dir pw))
>          (string-append "USER=" (passwd:name pw))
>          (remove (lambda (x)
>                    (or (string-prefix? "HOME=" x)
>                        (string-prefix? "USER=" x)))
>                  (or '#$environment-variables
>                      (default-environment-variables)))))

What would be nice is to provide in (shepherd support) or similar a
‘home-environment-variables’ procedure (or similar) that would add HOME=
and USER= to the given list of environment variables.

That would avoid duplication of the boilerplate above.

If you’d like to submit such a patch, it’d be welcome!

Thanks,
Ludo’.




This bug report was last modified 92 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.