Report forwarded
to bug-guix@gnu.org: bug#23170; Package guix.
(Thu, 31 Mar 2016 13:24:01 GMT) (full text, mbox, link).
Acknowledgement sent
to "Thompson, David" <dthompson2@worcester.edu>:
New bug report received and forwarded. Copy sent to bug-guix@gnu.org.
(Thu, 31 Mar 2016 13:24:01 GMT) (full text, mbox, link).
If service 'foo' is depended on by service 'bar', and both are
running, and one runs 'herd restart foo', both 'foo' and 'bar' are
stopped, but then only 'foo' is restarted. I think that the dependent
services that were stopped should also be restarted, otherwise the
user has to manually start them back up one at a time.
- Dave
Information forwarded
to bug-guix@gnu.org: bug#23170; Package guix.
(Sat, 25 Aug 2018 11:35:02 GMT) (full text, mbox, link).
I've written a patch to fix this. It's not super smart, but it
should do the job.
It currently targets the branch after my patch in #32408[1], but
it's technically an independent change.
[1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32408
Subject: Re: bug#23170: [PATCH shepherd] Restart dependent services on service
restart
Date: Sat, 25 Aug 2018 16:41:03 +0200
Hi again! :-)
Carlo Zancanaro <carlo@zancanaro.id.au> skribis:
> I've written a patch to fix this. It's not super smart, but it should
> do the job.
I wonder if there are cases where one might want to restart a service
without restarting its dependent services. We can probably ignore it
for now, but perhaps we’ll need to add a flag or a separate action later.
Thoughts?
> From 50dd3ef4888b04ea3b869da893b23ad69fad8971 Mon Sep 17 00:00:00 2001
> From: Carlo Zancanaro <carlo@zancanaro.id.au>
> Date: Sat, 25 Aug 2018 20:32:11 +1000
> Subject: [PATCH] service: Restart dependent services on service restart
>
> * modules/shepherd/service.scm (required-by?): New procedure.
> (stop): Return a list of canonical-names for stopped dependent services,
> including transitive dependencies.
> (action)[restart]: Start services based on the return value of stop.
> (fold-services): New procedure.
> * tests/restart.sh: New file.
> * Makefile.am (TESTS): Add tests/restart.sh.
[...]
> +# Restart test1 and make sure that both services are still running (ie. that
> +# test2 hasn't been stopped)
> +$herd restart test1
> +$herd status test1 | grep started
> +$herd status test2 | grep started
> +
> +# Now let's test with a transitive dependency
> +$herd start test3
> +$herd status test3 | grep started
> +
> +# After restarting test1 we want test3 to still be running
> +$herd restart test1
> +$herd status test1 | grep started
> +$herd status test2 | grep started
> +$herd status test3 | grep started
For clarity, should we do an explicit “herd stop test1” followed by
“herd start test1”? I know it’s currently equivalent under the hood,
but it might be slightly clearer. WDYT?
Otherwise it LGTM. Thanks for addressing these longstanding issues!
Ludo’.
Information forwarded
to bug-guix@gnu.org: bug#23170; Package guix.
(Sat, 25 Aug 2018 22:50:02 GMT) (full text, mbox, link).
On Sun, Aug 26 2018, Ludovic Courtès wrote:
> I wonder if there are cases where one might want to restart a
> service without restarting its dependent services. We can
> probably ignore it for now, but perhaps we’ll need to add a flag
> or a separate action later.
>
> Thoughts?
I think this is best served by 'herd stop', followed by 'herd
start'. This patch just special-cases the 'restart' action, so
manually stopping then starting a service will behave as the old
restart used to.
> For clarity, should we do an explicit “herd stop test1” followed
> by “herd start test1”? I know it’s currently equivalent under
> the hood, but it might be slightly clearer. WDYT?
Hopefully the above also answers this, too. I did consider whether
it was worth adding a test for 'herd stop' to make sure it still
stops dependent services, and 'herd start' to make sure it doesn't
start dependent services, but in the end I decided not to. I'm
happy to send through another patch to test these cases, though,
if you think it would be worthwhile.
Carlo
Subject: Re: bug#23170: [PATCH shepherd] Restart dependent services on service
restart
Date: Sun, 26 Aug 2018 23:08:34 +0200
Carlo Zancanaro <carlo@zancanaro.id.au> skribis:
> On Sun, Aug 26 2018, Ludovic Courtès wrote:
>> I wonder if there are cases where one might want to restart a
>> service without restarting its dependent services. We can probably
>> ignore it for now, but perhaps we’ll need to add a flag or a
>> separate action later.
>>
>> Thoughts?
>
> I think this is best served by 'herd stop', followed by 'herd
> start'. This patch just special-cases the 'restart' action, so
> manually stopping then starting a service will behave as the old
> restart used to.
Great, I had overlooked this.
>> For clarity, should we do an explicit “herd stop test1” followed by
>> “herd start test1”? I know it’s currently equivalent under the
>> hood, but it might be slightly clearer. WDYT?
>
> Hopefully the above also answers this, too.
It does, thanks!
> I did consider whether it was worth adding a test for 'herd stop' to
> make sure it still stops dependent services, and 'herd start' to make
> sure it doesn't start dependent services, but in the end I decided not
> to. I'm happy to send through another patch to test these cases,
> though, if you think it would be worthwhile.
No, that’s fine.
I forgot if this was already done, but perhaps you can add a bit in the
manual to insist that ‘restart’ is not quite the same as ‘stop’ +
‘start’.
Anyway, it all LGTM, thanks!
Ludo’.
Information forwarded
to bug-guix@gnu.org: bug#23170; Package guix.
(Sun, 26 Aug 2018 22:06:02 GMT) (full text, mbox, link).
Hey Ludo’!
On 27 August 2018 7:08:34 am AEST, ludo@gnu.org wrote:
>I forgot if this was already done, but perhaps you can add a bit in the manual to insist that ‘restart’ is not quite the same as ‘stop’ + ‘start’.
I hadn't done that, but I have now. There aren't many mentions of restart in the manual, but I changed the one that seemed most relevant.
>Anyway, it all LGTM, thanks!
Pushed! Thanks for the review.
Carlo
Subject: Re: bug#23170: [PATCH shepherd] Restart dependent services on service
restart
Date: Mon, 27 Aug 2018 08:05:17 +1000
Hey Ludo’!
On 27 August 2018 7:08:34 am AEST, ludo@gnu.org wrote:
>I forgot if this was already done, but perhaps you can add a bit in the manual to insist that ‘restart’ is not quite the same as ‘stop’ + ‘start’.
I hadn't done that, but I have now. There aren't many mentions of restart in the manual, but I changed the one that seemed most relevant.
>Anyway, it all LGTM, thanks!
Pushed! Thanks for the review.
Carlo
Information forwarded
to bug-guix@gnu.org: bug#23170; Package guix.
(Mon, 27 Aug 2018 11:06:01 GMT) (full text, mbox, link).
Subject: Re: bug#23170: [PATCH shepherd] Restart dependent services on service
restart
Date: Mon, 27 Aug 2018 13:05:07 +0200
Hi,
Carlo Zancanaro <carlo@zancanaro.id.au> skribis:
> Pushed! Thanks for the review.
Great!
I see that you also reverted the patch that removed the ‘EINTR-safe’
workaround. Could you explain why that was necessary? (It should not
be necessary with current Guile versions.)
Thank you,
Ludo’.
Information forwarded
to bug-guix@gnu.org: bug#23170; Package guix.
(Mon, 27 Aug 2018 12:43:02 GMT) (full text, mbox, link).
On Mon, Aug 27 2018, Ludovic Courtès wrote:
> I see that you also reverted the patch that removed the
> ‘EINTR-safe’ workaround. Could you explain why that was
> necessary? (It should not be necessary with current Guile
> versions.)
I'm not really sure of the details, but as I mentioned on IRC,
that commit stopped me from being able to boot. I grafted a new
version of the Shepherd and reconfigured my system, and when it
came up my screen was filled with messages complaining that it
couldn't create things in /dev because they already existed. I
tested the commits since the previous release and that was the one
that caused my problem.
I'd like to investigate further, but I have no idea what could be
causing it. All I have to go on so far is that I think the udev
service is getting respawned repeatedly, but I don't know why that
commit would cause that problem. After reverting that commit I
could successfully boot back into my system and everything is
working properly again.
Subject: Re: bug#23170: [PATCH shepherd] Restart dependent services on service
restart
Date: Mon, 27 Aug 2018 19:53:01 +0200
Carlo Zancanaro <carlo@zancanaro.id.au> writes:
>>Anyway, it all LGTM, thanks!
>
> Pushed! Thanks for the review.
>
> Carlo
Awesome! Thanks a lot Carlo for working on this :-)
Added tag(s) fixed.
Request was from Ludovic Courtès <ludo@gnu.org>
to control@debbugs.gnu.org.
(Sat, 05 Jan 2019 13:54:01 GMT) (full text, mbox, link).
bug closed, send any further explanations to
23170@debbugs.gnu.org and "Thompson, David" <dthompson2@worcester.edu>
Request was from Ludovic Courtès <ludo@gnu.org>
to control@debbugs.gnu.org.
(Sat, 05 Jan 2019 13:54:02 GMT) (full text, mbox, link).
bug archived.
Request was from Debbugs Internal Request <help-debbugs@gnu.org>
to internal_control@debbugs.gnu.org.
(Sun, 03 Feb 2019 12:24:05 GMT) (full text, mbox, link).
Debbugs is free software and licensed under the terms of the
GNU Public License version 2. The current version can be
obtained from https://bugs.debian.org/debbugs-source/.