From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: [PATCH 02/11] Use 'shepherd' instead of 'dmd' as init system. Date: Thu, 28 Jan 2016 00:10:27 +0300 Message-ID: <1453929036-10408-3-git-send-email-alezost@gmail.com> References: <1453929036-10408-1-git-send-email-alezost@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOXMf-00086U-FW for guix-devel@gnu.org; Wed, 27 Jan 2016 16:10:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOXMd-0006Uz-Js for guix-devel@gnu.org; Wed, 27 Jan 2016 16:10:57 -0500 Received: from mail-lb0-x244.google.com ([2a00:1450:4010:c04::244]:36494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOXMd-0006U3-BN for guix-devel@gnu.org; Wed, 27 Jan 2016 16:10:55 -0500 Received: by mail-lb0-x244.google.com with SMTP id ad5so896772lbc.3 for ; Wed, 27 Jan 2016 13:10:55 -0800 (PST) Received: from localhost.localdomain ([217.107.192.146]) by smtp.gmail.com with ESMTPSA id p66sm1045517lfe.42.2016.01.27.13.10.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jan 2016 13:10:54 -0800 (PST) In-Reply-To: <1453929036-10408-1-git-send-email-alezost@gmail.com> 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org * gnu/services/dmd.scm (dmd-boot-gexp): Use binary from 'shepherd' package. (dmd-root-service-type): Use 'shepherd' package. (%default-modules): Use (shepherd service) module. * gnu/services/base.scm (%root-file-system-dmd-service): Use 'stop-logging' procedure to close shepherd log. --- gnu/services/base.scm | 9 +++------ gnu/services/dmd.scm | 10 +++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 0399c00..fbb29c1 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès -;;; Copyright © 2015 Alex Kost +;;; Copyright © 2015, 2016 Alex Kost ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2015 Sou Bunnbu ;;; @@ -160,12 +160,9 @@ (call-with-blocked-asyncs (lambda () (let ((null (%make-void-port "w"))) - ;; Close 'dmd.log'. + ;; Close 'shepherd.log'. (display "closing log\n") - ;; XXX: Ideally we'd use 'stop-logging', but that one - ;; doesn't actually close the port as of dmd 0.1. - (close-port (@@ (dmd comm) log-output-port)) - (set! (@@ (dmd comm) log-output-port) null) + ((@ (shepherd comm) stop-logging)) ;; Redirect the default output ports.. (set-current-output-port null) diff --git a/gnu/services/dmd.scm b/gnu/services/dmd.scm index fb3d332..828d781 100644 --- a/gnu/services/dmd.scm +++ b/gnu/services/dmd.scm @@ -77,9 +77,9 @@ (false-if-exception (close-fdes fd)) (loop (+ 1 fd)))) - ;; Start dmd. - (execl (string-append #$dmd "/bin/dmd") - "dmd" "--config" #$dmd-conf))))) + ;; Start shepherd. + (execl (string-append #$shepherd "/bin/shepherd") + "shepherd" "--config" #$dmd-conf))))) (define dmd-root-service-type (service-type @@ -90,7 +90,7 @@ (extend append) (extensions (list (service-extension boot-service-type dmd-boot-gexp) (service-extension profile-service-type - (const (list dmd))))))) + (const (list shepherd))))))) (define %dmd-root-service ;; The root dmd service, aka. PID 1. Its parameter is a list of @@ -113,7 +113,7 @@ service that extends DMD-ROOT-SERVICE-TYPE and nothing else." (define %default-modules ;; Default set of modules visible in a service's file. - `((dmd service) + `((shepherd service) (oop goops) (guix build utils) (guix build syscalls))) -- 2.6.3