guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shepherd] Stopping service twice should not say “not found”


From: Ludovic Courtès
Subject: Re: [shepherd] Stopping service twice should not say “not found”
Date: Mon, 04 Feb 2019 23:41:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hello,

Ricardo Wurmus <address@hidden> skribis:

> requesting that a shepherd service (e.g. ’foo’) that has already been
> stopped be stopped again produces the error "service 'foo' could not be
> found".  This is confusing because it implies that ’foo’ is not a valid
> name.

Indeed.

> From c285d0f085e8e9c6a4ad347643f7186807735189 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <address@hidden>
> Date: Sun, 3 Feb 2019 23:25:22 +0100
> Subject: [PATCH] service: Don't raise error when stopping an already stopped
>  service.
>
> * modules/shepherd/service.scm (stop): If a service by the given name exists
> and is already stopped, then don't raise an error.

LGTM, though could you add a test?  There are already tests that grep
the output of “herd stop foo”; you’d just grep it a second time and
ensure it’s empty, and also ensure that $? is zero.

Thanks!

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]