mbox

[bug#46560,0/2] Activate system when switching generations.

Message ID 87czx06ubt.fsf@waegenei.re
Headers show

Message

Brice Waegeneire Feb. 16, 2021, 12:35 p.m. UTC
Hello,

As reported on previous bug report, rolling-back or switching generation
doesn't activate the system as a system reconfiguration would do.  This is
especially problematic when modifying in /run/setuid-programs, as it can't be
reverted easily.  Also it hinder modification in the activation script since
it's not straight forward to revert change made by those script without a
functional roll-back mechanism.

I'm not sure it's the right approach but at least it work: it add the
activate.scm script to the system profile and then load it when
switching-generation.

This is related to issues:
- #37596 and #38884 (they are duplicate)
- #36855 a more wider discussion

Cheers,
- Brice

Brice Waegeneire (2):
  gnu: services: Add activate script to the profile system directory.
  scripts: system: Activate system when switching generations.

 gnu/services.scm        | 10 +++++++++-
 guix/scripts/system.scm |  8 ++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

Comments

Brice Waegeneire March 4, 2021, 6:57 a.m. UTC | #1
Hello Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

> Brice Waegeneire <brice@waegenei.re> skribis:
>
> > Fixes #38884.
>
> Nitpick: “Fixes <https://bugs.gnu.org/38884>.”
>
> > * guix/scripts/system.scm (switch-to-system-generation): Load the
> > activate script for that generation.
>
> [...]
>
> > +          (switch-to-generation* %system-profile number)
> > +          (primitive-load activate))
>
> I suppose you need to wrap catch 'system-error here and to keep going
> upon ENOENT.

This patch set fixes both issues.

Cheers,
- Brice

Brice Waegeneire (2):
  gnu: services: Add activate script to the profile system directory.
  scripts: system: Activate system when switching generations.

 gnu/services.scm        | 10 +++++++++-
 guix/scripts/system.scm |  8 ++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)
Ludovic Courtès March 8, 2021, 2:15 p.m. UTC | #2
Hi Brice,

Brice Waegeneire <brice@waegenei.re> skribis:

> Brice Waegeneire (2):
>   gnu: services: Add activate script to the profile system directory.
>   scripts: system: Activate system when switching generations.

LGTM, thanks!

Ludo’.
Brice Waegeneire March 9, 2021, 6:12 a.m. UTC | #3
Hello Ludo,

Ludovic Courtès <ludo@gnu.org> writes:

> Brice Waegeneire <brice@waegenei.re> skribis:
>
>> Brice Waegeneire (2):
>>   gnu: services: Add activate script to the profile system directory.
>>   scripts: system: Activate system when switching generations.
>
> LGTM, thanks!

Pushed as df138dc20858725b90ed77be85f3318cbe1be73a and later. I'll close
#38884 and will do the same or comment #36855 and #37596 about the new
feature.

Cheers,
- Brice.