From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: One-shot Shepherd services Date: Fri, 3 May 2019 15:15:06 -0400 Message-ID: References: <87ftqfngda.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:57760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMded-00016s-Nj for guix-devel@gnu.org; Fri, 03 May 2019 15:15:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMdea-0007IT-Ak for guix-devel@gnu.org; Fri, 03 May 2019 15:15:30 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:44087) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMdeV-0006xC-Dl for guix-devel@gnu.org; Fri, 03 May 2019 15:15:24 -0400 Received: by mail-wr1-x42c.google.com with SMTP id c5so9103561wrs.11 for ; Fri, 03 May 2019 12:15:19 -0700 (PDT) In-Reply-To: <87ftqfngda.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Cc: Guix-devel On Thu, Apr 18, 2019 at 5:38 PM Ludovic Court=C3=A8s wrote: > > Hello Guix! > > Today I added support for =E2=80=9Cone-shot=E2=80=9D services in the Shep= herd: > > https://git.savannah.gnu.org/cgit/shepherd.git/commit/?id=3Dc121eedfff7= a50feddcf08e173d2b0dd807e8804 > > One-shot services start, perform a short action, and are immediately > marked as =E2=80=9Cstopped.=E2=80=9D (systemd has something similar: > .) > > The use case is initialization or cleanup actions like the =E2=80=98user-= homes=E2=80=99 > service. So far =E2=80=98user-homes=E2=80=99 is a regular service whose = =E2=80=98start=E2=80=99 method > always fails; as a result, we always see this message: > > Service user-homes could not be started. > > From there on, we=E2=80=99ll be able to mark this service as one-shot (pa= tch > below), and thus shepherd will notice that it successfully started (or > not) and yet mark it as stopped, which was always the intent. > > There are other cases where this could be useful. For instance, we > could turn service activation snippets into one-shot services. > > Since this augments the Shepherd API, I plan to release it as 0.6.0 > in time for Guix 1.0. It contains other rather minor changes compared > to 0.5.0. > > Feedback welcome! A big +1 from me. I use one-shot systemd services all the time. - Dave