From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: Service refactoring Date: Tue, 08 Sep 2015 10:48:11 -0400 Message-ID: <871te96k7o.fsf@netris.org> References: <87a8t3mc2v.fsf@netris.org> <87d1xyk45i.fsf@igalia.com> <87vbbn44zi.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 ([2001:4830:134:3::10]:35120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZKCq-0002wJ-UM for guix-devel@gnu.org; Tue, 08 Sep 2015 10:49:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZKCm-0004A0-Ms for guix-devel@gnu.org; Tue, 08 Sep 2015 10:49:08 -0400 In-Reply-To: <87vbbn44zi.fsf_-_@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\?\= \=\?utf-8\?Q\?\=22's\?\= message of "Sun, 06 Sep 2015 23:23:13 +0200") 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Andy Wingo skribis: > >> So then, for example, the elogind service would indicate that it >> installs udev rules, dbus interfaces, and polkit rules from the elogind >> package. The udev service would then query all services, adding rules >> from services that indicate that they extend the udev configuration. To >> do this I propose a "finalize-configuration" field in services. First, >> the services are collected into a list, as they are now. Next, Guix >> does something like this: >> >> (define (finalize-services services) >> (map (lambda (service) >> ((service-finalize service) service services)) >> services)) >> >> The default service-finalize will be (lambda (service services) >> service). WDYT? > > Yes, something like that. > > An important characteristic is that service types extend each other: > dbus extends dmd (by adding stuff into dmd.conf), polkit extends dbus > (through .service files), elogind extends polkit (through policy files) > and dbus and udev, and so on. > > Service types and their =E2=80=9Cextends=E2=80=9D relations form a DAG li= ke this: I think that Ludovic's proposal is excellent, and I'm sympathetic to his desire to minimize the amount of information services have about each other, but I have one concern: Will we ever encounter a case where two services need to be told about each other? More generally, the "needs to know about" graph might contain cycles. Even if there's not one today, we may encounter one tomorrow. I don't see a compelling reason to restrict this structure to be a DAG, and such a restriction may cause problems for us later. What do you think? Mark