unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrew Tropin <andrew@trop.in>
To: Oleg Pykhalov <go.wigust@gmail.com>
Cc: 51141@debbugs.gnu.org
Subject: bug#51141: guix home reconfigure does not apply changes to shepherd services
Date: Sat, 23 Oct 2021 10:11:20 +0300	[thread overview]
Message-ID: <87bl3gkyg7.fsf@trop.in> (raw)
In-Reply-To: <878rymt0m4.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3893 bytes --]

On 2021-10-22 02:32, Oleg Pykhalov wrote:

> Andrew Tropin <andrew@trop.in> writes:
>
> […]
>
>> According to what I see in the shepherd tests:
>> https://git.savannah.gnu.org/cgit/shepherd.git/tree/tests/replacement.sh?h=4c5176f5a7a5a1e7d7f258f585e8ed127a21b99a#n61
>>
>> and how it's implemented in home-shepherd:
>> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/home/services/shepherd.scm?h=7c3f28fdc4edc00f66801cd51a5ba08eee44f77f#n59
>>
>> It should work as you expect it.
>
> It doesn't.
>
>> Tried to do the following: I updated documentation field for a shepherd
>> service, reconfigured and it got loaded after I restarted a service.
>>
>> ~ $ herd doc state
>> Init, update and maybe destroy state.
>> ~ $ herd restart state
>> Service state has been stopped.
>> Service state has been started.
>> ~ $ herd doc state
>> Really init, update and maybe destroy state.
>>
>> Didn't check if start action gexp is updated too, but I expect it was.
>
> The start action is the interest, or configuration record, or service
> extension.

From the experiment above it's clear that new configuration got loaded
and service record get updated after restart (at least one field of it).

>
> (guix scripts system reconfigure) has a upgrade-shepherd-services
> procedure, which was created in 240b57f0ca576708ebf6cfa0dfe2803fa9ff2323
> and discussed in https://issues.guix.gnu.org/22039

The difference with update-shepherd-services is the usage of Shepherd
CLI in home service instead of Shepherd API in system service.  So the
problem can hide somewhere around this part.

Automatic unloading in home-service doesn't happens and as I said it's
by design to prevent cases of losing unsaved work.  However, it can be
implemented with an optional separate flag to shepherd configuration
record and extension to run-on-change-service or as it done in system
shepherd with the list of services, which doesn't have to be unloaded
automatically.

>
>
> [ The following text only describes how to reproduce the issue. ]
>
>
> When I tried to write goimapnotify service no changes applied after
> modifications in home-goimapnotify-shepherd-service [1] and [2], which
> are typical service-type and record.  I didn't have similar issues with
> self-written system services.
>
> [1]: https://gitlab.com/wigust/dotfiles/-/blob/ea2111906233099267f3b581b4aae39ad9645c2d/dotfiles/guixsd/modules/home/services/mail.scm#L28-45
> [2]: https://gitlab.com/wigust/dotfiles/-/blob/ea2111906233099267f3b581b4aae39ad9645c2d/dotfiles/guixsd/home.scm#L40-65
>

I'm out of office for next 1.5 week, will check it when I come back.

>
> Service extension also requires to unload service, e.g. mcron service
> extension in [1] and [2].
>
> [1]: https://gitlab.com/wigust/dotfiles/-/blob/ea2111906233099267f3b581b4aae39ad9645c2d/dotfiles/guixsd/modules/home/services/package-management.scm#L16-50
> [2]: https://gitlab.com/wigust/dotfiles/-/blob/ea2111906233099267f3b581b4aae39ad9645c2d/dotfiles/guixsd/home.scm#L154-161
>
> If I remove the guix-delete-generations service from home configuration,
> mcron job still exists according to 'herd schedule mcron'.
> --8<---------------cut here---------------start------------->8---
> (home-environment
>  (services
>   (list (service guix-delete-generations-service-type ;; ...
>                  ))))
> --8<---------------cut here---------------end--------------->8---
>
> Oleg.

BTW, please remove unreviewed changes to interpose function, they are
incorrect.
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/configuration.scm?id=41492639e0223dc8fc1a357e1f9537577c055db7#n362

The explanation: https://issues.guix.gnu.org/50967#66
The correct version: https://git.sr.ht/~abcdw/rde/commit/4961f47c3f97c21799a39b3e906fa99b2625f331

-- 
Best regards,
Andrew Tropin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

      reply	other threads:[~2021-10-23  7:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 22:53 bug#51141: guix home reconfigure does not apply changes to shepherd services Oleg Pykhalov
2021-10-15  6:21 ` Andrew Tropin
2021-10-16 15:06   ` Oleg Pykhalov
2021-10-18 10:04     ` Andrew Tropin
2021-10-21 23:32       ` Oleg Pykhalov
2021-10-23  7:11         ` Andrew Tropin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bl3gkyg7.fsf@trop.in \
    --to=andrew@trop.in \
    --cc=51141@debbugs.gnu.org \
    --cc=go.wigust@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).