From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Service refactoring Date: Thu, 24 Sep 2015 19:09:02 +0200 Message-ID: <87oagrycb5.fsf@gnu.org> References: <87a8t3mc2v.fsf@netris.org> <87d1xyk45i.fsf@igalia.com> <87vbbn44zi.fsf_-_@gnu.org> <87a8shp05k.fsf@gnu.org> <87r3lsrxqp.fsf@igalia.com> <877fnjn4nd.fsf@gnu.org> <87r3lomfgs.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]:33131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfA17-0001FN-6Y for guix-devel@gnu.org; Thu, 24 Sep 2015 13:09:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfA14-00029Y-02 for guix-devel@gnu.org; Thu, 24 Sep 2015 13:09:09 -0400 In-Reply-To: (=?utf-8?B?IuWui+aWh+atpiIncw==?= message of "Thu, 24 Sep 2015 17:33:07 +0800") 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: =?utf-8?B?5a6L5paH5q2m?= Cc: guix-devel =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > 2015-09-24 15:41 GMT+08:00 Ludovic Court=C3=A8s : >> "Thompson, David" skribis: >> >>> On Mon, Sep 21, 2015 at 12:00 PM, Ludovic Court=C3=A8s w= rote: >>>> Andy Wingo skribis: >>>> >>>>> On Sun 20 Sep 2015 15:42, ludo@gnu.org (Ludovic Court=C3=A8s) writes: >>>>> >>>>>> I=E2=80=99m quite happy with the result, but comments are welcome! = I=E2=80=99ll convert >>>>>> some more services to see how it goes. >>>>> >>>>> Neat! Sounds great. One question: there are some services like colo= rd >>>>> or geoclue that don't need to be managed by DMD, but are just declared >>>>> as services so that their users are created, there /var/foo directori= es >>>>> are created, etc. The can be started by D-Bus as needed. Does the n= ew >>>>> design support services of this kind? >>>> >>>> Yes it does. > Great news! I don't miss NixOS's modules anymore :-) Heheh, NixOS modules are a very good competitor. ;-) I think this model handles multiple service instances better than NixOS modules. NixOS services can be enabled/disabled, for instance with =E2=80=98services.httpd.enable =3D true=E2=80=99 or =E2=80=98services.opens= sh.enable =3D true=E2=80=99, but I don=E2=80=99t think there=E2=80=99s a general mechanism to have multiple = instances of httpd or sshd. Also in NixOS any service can do =E2=80=98foo.bar =3D baz=E2=80=99 and chan= ge an unrelated OS setting, which is not possible here. I find the fixed-point approach of NixOS modules very elegant, but it also complicates things: It=E2=80=99s easy to enter an infinite recursion, = and one has to carefully use =E2=80=98mkIf=E2=80=99 and similar constructs wher= e it matters, which is non-obvious. > I think the difference is that we don't seperate options and implementati= ons > like NixOS did, 'service-type' have both in one place. =E2=80=98service-type=E2=80=99 is sort-of an interface: it describes how se= rvices are composed, but not what they do. > So, our services is highly tie to gexps and dmd (that's ok). The whole thing is rather tied to gexps, but it=E2=80=99s not tied to dmd. = dmd is just a service that has nothing special, and (gnu system) does not embed any knowledge about dmd. The only service type that=E2=80=99s known to (gnu system) is =E2=80=98boot-service-type=E2=80=99. Thanks for your feedback! Ludo=E2=80=99.