From mboxrd@z Thu Jan 1 00:00:00 1970 From: iyzsong@member.fsf.org (=?utf-8?B?5a6L5paH5q2m?=) Subject: [PATCH] services: dbus: Build '/etc/dbus-1/system-local.conf'. Date: Sun, 18 Oct 2015 14:44:42 +0800 Message-ID: <87r3ks4qw5.fsf@member.fsf.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnhiM-000458-Db for guix-devel@gnu.org; Sun, 18 Oct 2015 02:45:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnhiC-00018d-0r for guix-devel@gnu.org; Sun, 18 Oct 2015 02:44:59 -0400 Received: from m50-132.163.com ([123.125.50.132]:43308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnhiA-00018O-UO for guix-devel@gnu.org; Sun, 18 Oct 2015 02:44:55 -0400 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 --=-=-= Content-Type: text/plain This patch is for the 'dbus-update' branch, I test with %desktop-services, it seem works. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-services-dbus-Build-etc-dbus-1-system-local.conf.patch Content-Transfer-Encoding: quoted-printable >From 96e156d36444b197bb5d07d8d680ec4e85863f83 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?=3DE5=3DAE=3D8B=3DE6=3D96=3D87=3DE6=3DAD=3DA6?=3D Date: Sun, 18 Oct 2015 14:18:52 +0800 Subject: [PATCH] services: dbus: Build '/etc/dbus-1/system-local.conf'. * gnu/services/dbus.scm (dbus-etc-files): New procedure. (dbus-dmd-service): Remove the use of '--config-file'. (dbus-configuration-directory): Adjust accordingly. (dbus-root-service-type): Add extension of ETC-SERVICE-TYPE. --- gnu/services/dbus.scm | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index e4ecd96..1fa910a 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2013, 2014, 2015 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2015 Sou Bunnbu ;;; ;;; This file is part of GNU Guix. ;;; @@ -41,9 +42,9 @@ (services dbus-configuration-services ;list of (default '()))) =20 -(define (dbus-configuration-directory dbus services) - "Return a configuration directory for @var{dbus} that includes the -@code{etc/dbus-1/system.d} directories of each package listed in +(define (dbus-configuration-directory services) + "Return a directory contains the @code{system-local.conf} file for DBUS = that +includes the @code{etc/dbus-1/system.d} directories of each package listed= in @var{services}." (define build #~(begin @@ -65,13 +66,6 @@ services))) =20 (mkdir #$output) - (copy-file (string-append #$dbus "/etc/dbus-1/system.conf") - (string-append #$output "/system.conf")) - - ;; The default 'system.conf' has an clause for - ;; 'system.d', so create it. - (mkdir (string-append #$output "/system.d")) - ;; 'system-local.conf' is automatically included by the default ;; 'system.conf', so this is where we stuff our own things. (call-with-output-file (string-append #$output "/system-local.conf= ") @@ -81,6 +75,12 @@ =20 (computed-file "dbus-configuration" build)) =20 +(define (dbus-etc-files config) + "Return a list of FILES for @var{etc-service-type} to build the +@code{/etc/dbus-1} directory." + (list `("dbus-1" ,(dbus-configuration-directory + (dbus-configuration-services config))))) + (define %dbus-accounts ;; Accounts used by the system bus. (list (user-group (name "messagebus") (system? #t)) @@ -118,20 +118,15 @@ (execl prog))) (waitpid pid))))))) =20 -(define dbus-dmd-service - (match-lambda - (($ dbus services) - (let ((conf (dbus-configuration-directory dbus services))) - (list (dmd-service - (documentation "Run the D-Bus system daemon.") - (provision '(dbus-system)) - (requirement '(user-processes)) - (start #~(make-forkexec-constructor - (list (string-append #$dbus "/bin/dbus-daemon") - "--nofork" - (string-append "--config-file=3D" #$conf - "/system.conf")))) - (stop #~(make-kill-destructor)))))))) +(define (dbus-dmd-service config) + (list (dmd-service + (documentation "Run the D-Bus system daemon.") + (provision '(dbus-system)) + (requirement '(user-processes)) + (start #~(make-forkexec-constructor + (list (string-append #$dbus "/bin/dbus-daemon") + "--nofork" "--system"))) + (stop #~(make-kill-destructor))))) =20 (define dbus-root-service-type (service-type (name 'dbus) @@ -140,6 +135,8 @@ dbus-dmd-service) (service-extension activation-service-type dbus-activation) + (service-extension etc-service-type + dbus-etc-files) (service-extension account-service-type (const %dbus-accounts)))) =20 --=20 2.5.0 --=-=-=--