From patchwork Sat Dec 1 02:31:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Carlo Zancanaro X-Patchwork-Id: 361 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 95AD716838; Sat, 1 Dec 2018 02:33:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 6066916822 for ; Sat, 1 Dec 2018 02:33:10 +0000 (GMT) Received: from localhost ([::1]:35490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSv5h-0006G5-6R for patchwork@mira.cbaines.net; Fri, 30 Nov 2018 21:33:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSv5e-0006Fy-N5 for guix-patches@gnu.org; Fri, 30 Nov 2018 21:33:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSv5a-0005CJ-OZ for guix-patches@gnu.org; Fri, 30 Nov 2018 21:33:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:52459) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gSv5a-0005C9-GW for guix-patches@gnu.org; Fri, 30 Nov 2018 21:33:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gSv5a-0008PA-8e for guix-patches@gnu.org; Fri, 30 Nov 2018 21:33:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33508] [PATCH] gnu: Add ability to restart services on system reconfigure Resent-From: Carlo Zancanaro Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Dec 2018 02:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33508 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: =?utf-8?q?Cl=C3=A9ment?= Lassieur Received: via spool by 33508-submit@debbugs.gnu.org id=B33508.154363152332227 (code B ref 33508); Sat, 01 Dec 2018 02:33:02 +0000 Received: (at 33508) by debbugs.gnu.org; 1 Dec 2018 02:32:03 +0000 Received: from localhost ([127.0.0.1]:56717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gSv4d-0008Ni-0P for submit@debbugs.gnu.org; Fri, 30 Nov 2018 21:32:03 -0500 Received: from zancanaro.com.au ([45.76.117.151]:49738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gSv4Z-0008NF-N0 for 33508@debbugs.gnu.org; Fri, 30 Nov 2018 21:32:00 -0500 Received: from jolteon (210-1-202-160-cpe.spintel.net.au [210.1.202.160]) by zancanaro.com.au (Postfix) with ESMTPSA id F2BA7215D2; Sat, 1 Dec 2018 02:31:55 +0000 (UTC) References: <87efb8m5gy.fsf@zancanaro.id.au> <871s78ypr9.fsf@lassieur.org> <875zwj8uqz.fsf@zancanaro.id.au> <87k1kzd02u.fsf@lassieur.org> <87lg5fsdof.fsf@zancanaro.id.au> <87bm66higm.fsf@lassieur.org> User-agent: mu4e 1.0; emacs 26.1 From: Carlo Zancanaro In-reply-to: <87bm66higm.fsf@lassieur.org> Date: Sat, 01 Dec 2018 13:31:48 +1100 Message-ID: <87va4eugdn.fsf@zancanaro.id.au> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 33508@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hey Clément, I'm still working through my thoughts on how all of this should work. I feel like there are a few different use-cases that change the trade-offs (eg. servers vs desktops, multi-user vs single-user) and I don't know what the best defaults are, or the most useful ways to vary that behaviour. I've attached my most recent version of my patches. I haven't had a chance to test them (so they may have really dumb mistakes), but they should implement the idea of restart-actions as procedures. On Fri, Nov 30 2018, Clément Lassieur wrote: > It could also detect whether you pass a symbol or a procedure. > In most cases that would be a symbol which would allow static > analysis. But one could still customize it with a procedure. I don't like this way of having two different representations for the same thing. In my current implementation there are three procedures, {always,manually,never}-restart, which can be used directly in the place of the old symbols (thus we can check for those strategies with eq?). Carlo From 2077919dca604c94b09cf105c33987daa8c46304 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 26 Nov 2018 22:38:26 +1100 Subject: [PATCH 3/3] services: Always restart guix daemon * gnu/services/base.scm (guix-shepherd-service): Add restart-strategy of always-restart. --- gnu/services/base.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 228d3c592..37d60720d 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1573,6 +1573,7 @@ failed to register hydra.gnu.org public key: ~a~%" status)))))))) (documentation "Run the Guix daemon.") (provision '(guix-daemon)) (requirement '(user-processes)) + (restart-strategy always-restart) (modules '((srfi srfi-1))) (start #~(make-forkexec-constructor -- 2.19.2