From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: Configuring a service but not starting it on boot Date: Wed, 28 Nov 2018 10:34:22 +0100 Message-ID: <87y39dy28x.fsf@lassieur.org> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRwEp-0004Ga-Ns for help-guix@gnu.org; Wed, 28 Nov 2018 04:34:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRwEk-0007Mq-Cw for help-guix@gnu.org; Wed, 28 Nov 2018 04:34:30 -0500 Received: from mail.lassieur.org ([83.152.10.219]:36834) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gRwEk-0007Kd-5G for help-guix@gnu.org; Wed, 28 Nov 2018 04:34:26 -0500 In-reply-to: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Arun Isaac Cc: help-guix@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Arun, Arun Isaac writes: > I would like to have the a service (specifically the tor service) listed > in my config.scm and configured using `guix system reconfigure > config.scm'. But, I do not want the service to start up at boot time. I > want to start/stop it using `herd' later as and when I require it. How > do I achieve this? > > Thanks! Attached is a hack I did a while ago. Hope it helps, Cl=C3=A9ment --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=dont-auto-start.patch Content-Transfer-Encoding: quoted-printable commit 5ebc46a52e543c316924ac936bb65c3ae7f113bb Author: Cl=C3=A9ment Lassieur Date: Fri May 5 15:11:37 2017 +0200 guix: don't auto-start nginx diff --git a/guix/configs/modules/rodion/web.scm b/guix/configs/modules/rod= ion/web.scm index 5c26651..35fe3d3 100644 --- a/guix/configs/modules/rodion/web.scm +++ b/guix/configs/modules/rodion/web.scm @@ -1,6 +1,8 @@ (define-module (rodion web) #:use-module (gnu services) #:use-module (gnu services web) + #:use-module (srfi srfi-1) ; find + #:use-module (gnu services shepherd) ; shepherd-root-service-type #:export (%my-nginx-service)) =20 (define my-nginx-configuration @@ -18,5 +20,29 @@ (uri "/") (body (list "index index.html;")))))))))) =20 +(define (my-nginx-shepherd-service nginx-conf) + (let ((nginx-shepherd-service + (service-extension-compute + (find (lambda (ext) + (eq? (service-extension-target ext) + shepherd-root-service-type)) + (service-type-extensions nginx-service-type))))) + (list + (shepherd-service + (inherit (car (nginx-shepherd-service nginx-conf))) + (auto-start? #f))))) + +(define my-nginx-service-type + (service-type + (inherit nginx-service-type) + (extensions + (cons + (service-extension shepherd-root-service-type + my-nginx-shepherd-service) + (remove (lambda (ext) + (eq? (service-extension-target ext) + shepherd-root-service-type)) + (service-type-extensions nginx-service-type)))))) + (define %my-nginx-service - (service nginx-service-type my-nginx-configuration)) + (service my-nginx-service-type my-nginx-configuration)) --=-=-=--