GNU bug report logs - #46209
46043 breaks booting with custom shepherd package

Previous Next

Package: guix;

Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>

Date: Sun, 31 Jan 2021 12:47:01 UTC

Severity: normal

Done: Oleg Pykhalov <go.wigust <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 46209 in the body.
You can then email your comments to 46209 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#46209; Package guix. (Sun, 31 Jan 2021 12:47:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 31 Jan 2021 12:47:01 GMT) Full text and rfc822 format available.

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

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: bug-guix <bug-guix <at> gnu.org>
Subject: 46043 breaks booting with custom shepherd package
Date: Sun, 31 Jan 2021 15:46:34 +0300
[Message part 1 (text/plain, inline)]
Before applied patch [1] I used a hack to override shepherd package:

    (module-set! (resolve-module '(gnu packages admin)) 'shepherd shepherd-patched)

Now on Guix commit eb6b061 I cannot use the previous override, and also
the mentioned in [1] way overriding shepherd package doesn't work:

    (shepherd-root-service-type config => (shepherd-configuration
                                           (inherit config)
                                           (shepherd shepherd-patched)))

I got error about undefined ‘#:supplementary-groups’ which added in
‘shepherd-patched’, so I assume my ‘shepherd-patched’ package not used.

[1] https://issues.guix.gnu.org/46043
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#46209; Package guix. (Sun, 31 Jan 2021 16:27:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Oleg Pykhalov <go.wigust <at> gmail.com>, 46209 <at> debbugs.gnu.org
Subject: Re: bug#46209: 46043 breaks booting with custom shepherd package
Date: Sun, 31 Jan 2021 17:26:37 +0100
[Message part 1 (text/plain, inline)]
On Sun, 2021-01-31 at 15:46 +0300, Oleg Pykhalov wrote:
> Before applied patch [1] I used a hack to override shepherd package:
> 
>     (module-set! (resolve-module '(gnu packages admin)) 'shepherd shepherd-patched)
> 
> Now on Guix commit eb6b061 I cannot use the previous override, and also
> the mentioned in [1] way overriding shepherd package doesn't work:
> 
>     (shepherd-root-service-type config => (shepherd-configuration
>                                            (inherit config)
>                                            (shepherd shepherd-patched)))
> 
> I got error about undefined ‘#:supplementary-groups’ which added in
> ‘shepherd-patched’, so I assume my ‘shepherd-patched’ package not used.
> 
> [1] https://issues.guix.gnu.org/46043

Can you post your operating system configuration definition?
Also, were does the error about undefined "#:supplementary-groups"
appear? When booting, when reconfiguring a ‘live’ system, when
guix is compiling the shepherd services to .go?

A pitfall to take in mind: it's the ‘essential-services’ field
you need to modify, not the ‘services’ field of ‘operating-system’.
My original example at [1] was incorrect.  A corrected example:

(operating-system
 [...]
 (services [don't modify this])
 (essential-services
  (modify-services (operating-system-default-essential-services
                    this-operating-system)
    (shepherd-root-service-type c =>
                                (shepherd-configuration
                                 (inherit c)
                                 (shepherd-patched))))))


Maxime
-- 
Maxime Devos <maximedevos <at> telenet.be>
PGP Key: C1F3 3EE2 0C52 8FDB 7DD7  011F 49E3 EE22 1917 25EE
Freenode handle: mdevos
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#46209; Package guix. (Sun, 31 Jan 2021 19:50:01 GMT) Full text and rfc822 format available.

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

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 46209 <at> debbugs.gnu.org
Subject: Re: bug#46209: 46043 breaks booting with custom shepherd package
Date: Sun, 31 Jan 2021 22:49:30 +0300
[Message part 1 (text/plain, inline)]
Hello,

Thank you for the fast responce.

First of all I want to ask did you try to override Shepherd yourself?

It would be helpful to have a paragraph in the documentation how to
override the Shepherd, and if you know a proper way, please add a small
example of operating-system definition with overriden Shepherd and a
basic service like OpenSSH.

Maxime Devos <maximedevos <at> telenet.be> writes:

> On Sun, 2021-01-31 at 15:46 +0300, Oleg Pykhalov wrote:
>> Before applied patch [1] I used a hack to override shepherd package:
>> 
>>     (module-set! (resolve-module '(gnu packages admin)) 'shepherd shepherd-patched)
>> 
>> Now on Guix commit eb6b061 I cannot use the previous override, and also
>> the mentioned in [1] way overriding shepherd package doesn't work:
>> 
>>     (shepherd-root-service-type config => (shepherd-configuration
>>                                            (inherit config)
>>                                            (shepherd shepherd-patched)))
>> 
>> I got error about undefined ‘#:supplementary-groups’ which added in
>> ‘shepherd-patched’, so I assume my ‘shepherd-patched’ package not used.
>> 
>> [1] https://issues.guix.gnu.org/46043
>
> Can you post your operating system configuration definition?
> Also, were does the error about undefined "#:supplementary-groups"
> appear? When booting, when reconfiguring a ‘live’ system, when
> guix is compiling the shepherd services to .go?

While booting (as I understand in initrd).  If I run (system "/bin/sh"),
then "ps auxwww" I got only shepherd and /bin/sh in the process list.

I can publish, but it's too big [1], so if you don't mind I prepared a
virtual-machine to reproduce the issue.  Basically I don't even need to
use a patched shepherd to break the VM (result attached as a screenshot
below).

[vm-image.tmpl (text/x-scheme, attachment)]
[Message part 3 (text/plain, inline)]
> A pitfall to take in mind: it's the ‘essential-services’ field
> you need to modify, not the ‘services’ field of ‘operating-system’.
> My original example at [1] was incorrect.  A corrected example:
>
> (operating-system
>  [...]
>  (services [don't modify this])
>  (essential-services
>   (modify-services (operating-system-default-essential-services
>                     this-operating-system)
>     (shepherd-root-service-type c =>
>                                 (shepherd-configuration
>                                  (inherit c)
>                                  (shepherd-patched))))))

[Screenshot_2021-01-31_22-30-05.png (image/png, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#46209; Package guix. (Sun, 31 Jan 2021 20:37:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 46209 <at> debbugs.gnu.org
Subject: Re: bug#46209: 46043 breaks booting with custom shepherd package
Date: Sun, 31 Jan 2021 21:35:59 +0100
[Message part 1 (text/plain, inline)]
On Sun, 2021-01-31 at 22:49 +0300, Oleg Pykhalov wrote:
>   (operating-system
> 
>     (inherit base-system)
> 
>     (essential-services
> 
>      (modify-services (operating-system-default-essential-services base-system)
> 
>        (shepherd-root-service-type config => (shepherd-configuration
> 
>                                               (inherit config)
> 
>                                               (shepherd shepherd)))))))

I'm currently running "guix time-machine etcetera", which hasn't completed yet,
but here's some quick speculation on what could have went wrong:

You shouldn't write (operating-system-default-essential-services base-system),
but rather (operating-system-default-essential-services this-operating-system).

The essential-services field is thunked, basically that means that the expression
under essential-services can refer to the operating-system definition itself,
using the macro this-operating-system.

A  potentially fixed configuration is attached, I'll try to run it in a VM.
[Message part 2 (text/html, inline)]
[reproduce-shepherd-bug.scm (text/x-scheme, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#46209; Package guix. (Sun, 31 Jan 2021 20:58:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 46209 <at> debbugs.gnu.org
Subject: Re: bug#46209: 46043 breaks booting with custom shepherd package
Date: Sun, 31 Jan 2021 21:57:00 +0100
[Message part 1 (text/plain, inline)]
When using the operating system configuration
adjusted to use this-operating-system, the VM
boots just fine for me (adjusted configuration
should be sent with previous e-mail).  Could
you confirm?

I haven't tried using the original system
configuration yet.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#46209; Package guix. (Sun, 31 Jan 2021 21:10:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 46209 <at> debbugs.gnu.org
Subject: Re: bug#46209: 46043 breaks booting with custom shepherd package
Date: Sun, 31 Jan 2021 22:09:22 +0100
[Message part 1 (text/plain, inline)]
On Sun, 2021-01-31 at 22:49 +0300, Oleg Pykhalov wrote:
> [...]
> First of all I want to ask did you try to override Shepherd yourself?

Yes, and I can confirm I could use #:supplementary-groups in
service definitions.  I override Shepherd with the mechanism in [1],
not with module-set!, however.

> It would be helpful to have a paragraph in the documentation how to
> override the Shepherd, and if you know a proper way, please add a small
> example of operating-system definition with overriden Shepherd and a
> basic service like OpenSSH.

Yes, would be very helpful, especially as it's easy to get wrong.
I'm currently occupied with other things, though.  As for an example:
your system configuration might do (as adjusted per previous e-mails),
with the following block ...

 (essential-services
  (modify-services
   (operating-system-default-essential-services this-operating-system)
   (shepherd-root-service-type 
config => (shepherd-configuration
                                          (inherit config)
                                          (shep
herd shepherd)))))
replaced by ...

 (essential-services
  (modify-services
   (operating-system-default-essential-services this-operating-system)
   (shepherd-root-service-type 
config => (shepherd-configuration
                                          (inherit config)
                                          (shep
herd shepherd-patched)))))

(otherwise no change in Shepherd is made), where shepherd-patched should
be defined somewhere in the beginning of the configuration file.
You could use your own shepherd-patched, or my shepherd-latest (attached):

[1] https://issues.guix.gnu.org/46043

[extra-packages.scm (text/x-scheme, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#46209; Package guix. (Sun, 31 Jan 2021 22:41:01 GMT) Full text and rfc822 format available.

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

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 46209 <at> debbugs.gnu.org
Subject: Re: bug#46209: 46043 breaks booting with custom shepherd package
Date: Mon, 01 Feb 2021 01:40:09 +0300
[Message part 1 (text/plain, inline)]
Maxime Devos <maximedevos <at> telenet.be> writes:

> When using the operating system configuration
> adjusted to use this-operating-system, the VM
> boots just fine for me (adjusted configuration
> should be sent with previous e-mail).  Could
> you confirm?

Thank you!  VM boots, and my desktop machine boots with shepherd-patched
and #:supplementary-groups field

    (essential-services
     (modify-services (operating-system-default-essential-services this-operating-system)
       (shepherd-root-service-type config => (shepherd-configuration
                                              (inherit config)
                                              (shepherd shepherd-patched)))))
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#46209; Package guix. (Sun, 31 Jan 2021 22:56:02 GMT) Full text and rfc822 format available.

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

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 46209 <at> debbugs.gnu.org
Subject: Re: bug#46209: 46043 breaks booting with custom shepherd package
Date: Mon, 01 Feb 2021 01:55:10 +0300
[Message part 1 (text/plain, inline)]
Maxime Devos <maximedevos <at> telenet.be> writes:

[…]

>> It would be helpful to have a paragraph in the documentation how to
>> override the Shepherd, and if you know a proper way, please add a small
>> example of operating-system definition with overriden Shepherd and a
>> basic service like OpenSSH.
>
> Yes, would be very helpful, especially as it's easy to get wrong.
> I'm currently occupied with other things, though.  

If you don't mind I could push the following instruction:

[0001-doc-Explain-how-to-set-custom-Shepherd-package.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#46209; Package guix. (Mon, 01 Feb 2021 08:16:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 46209 <at> debbugs.gnu.org
Subject: Re: bug#46209: 46043 breaks booting with custom shepherd package
Date: Mon, 01 Feb 2021 09:15:31 +0100
[Message part 1 (text/plain, inline)]
> If you don't mind I could push the following instruction: [...]

Linguistic nitpick: In ‘The following example specifies the Shepherd package
for operating system’ doesn't seem to be grammatical.  Perhaps write
‘[...] for the operating system’ or ‘[...] of the operating system.’?

Otherwise LGTM!

Thanks,
Maxime
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#46209; Package guix. (Mon, 01 Feb 2021 09:20:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 46209 <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#46209: 46043 breaks booting with custom shepherd package
Date: Mon, 01 Feb 2021 10:18:56 +0100
Hi Oleg,

Oleg Pykhalov <go.wigust <at> gmail.com> skribis:

> From f94a63bb35f6f05bd429703ec3102d15cfb1e382 Mon Sep 17 00:00:00 2001
> From: Oleg Pykhalov <go.wigust <at> gmail.com>
> Date: Mon, 1 Feb 2021 01:49:00 +0300
> Subject: [PATCH] doc: Explain how to set custom Shepherd package.
>
> * doc/guix.texi (Shepherd Services): Give example on how to set custom
> Shepherd package.

[...]

> +The following example specifies the Shepherd package for operating
                                                           ^
Missing “the”, as Maxime wrote.

> +   (modify-services (operating-system-default-essential-services this-operating-system)
> +     (shepherd-root-service-type config => (shepherd-configuration
> +					    (inherit config)
> +					    (shepherd my-shepherd))))))

Please make sure there are no tabs and shorten lines in the manual to
~72 chars so that the PDF output looks good.

Otherwise LGTM too, thanks!

Ludo’.




Reply sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
You have taken responsibility. (Mon, 01 Feb 2021 18:52:03 GMT) Full text and rfc822 format available.

Notification sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
bug acknowledged by developer. (Mon, 01 Feb 2021 18:52:03 GMT) Full text and rfc822 format available.

Message #37 received at 46209-done <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 46209-done <at> debbugs.gnu.org
Subject: Re: bug#46209: 46043 breaks booting with custom shepherd package
Date: Mon, 01 Feb 2021 21:51:26 +0300
[Message part 1 (text/plain, inline)]
Pushed to master as 847c816ddd3a38c865da460cb7b22cf665db162f
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 02 Mar 2021 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 56 days ago.

Previous Next


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