From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: Services and log management/monitoring Date: Sat, 04 May 2019 00:01:10 -0700 Message-ID: <8736lu66vd.fsf@gmail.com> References: <67f09d8d-3ca6-90a0-6e72-c85ec9d1572f@s.rendaw.me> <87bm1472ha.fsf@gnu.org> <4428ea68-57fe-5459-0e26-529bc05d0b31@s.rendaw.me> <87imvaci2p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:55319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMoff-0002HC-AE for help-guix@gnu.org; Sat, 04 May 2019 03:01:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMofe-0003w6-8I for help-guix@gnu.org; Sat, 04 May 2019 03:01:19 -0400 In-Reply-To: (rendaw's message of "Sat, 20 Apr 2019 00:47:27 +0900") 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: rendaw <7e9wc56emjakcm@s.rendaw.me> Cc: help-guix@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable rendaw <7e9wc56emjakcm@s.rendaw.me> writes: > I'm fairly sure that's not what it means, but if extends isn't an > inheritance relationship and it's not a dependency relationship I'm not > sure what it is. In this context, when we say that a service A extends a service B, my understanding is that we mean that A changes (customizes) something about B. It is definitely not inheritance. And because A changes something about B, I don't think "A depends on B" is the best way to think about it. For example, the guix-service-type extends the account-service-type. The former provides the latter with a list of user and group accounts. In this way, the guix-service-type tells the account-service-type what users and groups the guix service needs in order to run. When you add a service of the guix-service-type to your operating system declaration's list of services (it's already there by default), the account-service-type will know what users and groups are required by the guix-service-type, and it will create them automatically. We say the guix-service-type "extends" the account-service-type because the former provides the latter with a list of users/groups to create. That is what we mean by "extension". Via this "extension" mechanism, it is possible to make cross-cutting changes that affect many different parts of the system, without making a bunch of changes to a bunch of services. For example, if the tor-service-type also needs to create a user account and group in order to do its job, it can simply extend the activation-service-type, just like the guix-service-type did. And if something about the way we create user accounts or groups needs to change, we can change it for all users and groups just by modifying one place: the account-service-type. You might be wondering: if the account-service-type is extended by user and group accounts, how are other services extended? The answer is that the type of object used depends on how the services are defined. The services participating in the extension define their own contract, within the confines of the general "extension mechanism" that Guix provides. Many services document how they can be extended in the manual, but some do not, and you might have to look at the source or existing examples to figure it out, which is not so great. Note that if you dig into the code, you will find that the term "extension" can also refer to a specific record type called , described in the "Service Reference" section of the manual, and defined in the gnu/services.scm file. If you want to learn more about it, I suggest reading the manual and also the source code - specifically the 'fold-services' procedure in gnu/services.scm, which is where the actual extension mechanism is implemented. The manual section is helpful, but due to some word ambiguities, it is a little difficult to follow the first time through. Some diagrams could help a lot in explaining the concepts. I hope this email helped a little. =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlzNOLYACgkQ3UCaFdgi Rp2nZhAAh7aLd7i//BSq6NQ69/ctuq7qk+DZGuWKotpzDX2dfrCWVXx3ZU1L5nkm g4zqYJOb4DjwvEZC2rQuuLdftTSZTKxVCz3vpusKokgV/u3vgLWOLsE8XjidS8gB 6VPsAECriPjLSITuZyie3qm1nMDZ5WumKVm0V+NdlASljbEF9jXY1HoZ2hJZM1Wh YEKf+k053hte6OqCO/tiNZUoNQl2RKwBEL5ANoXS0/gf/wlgL81+Y0AkmjziAvZJ ZvuJqc95kOpRpoMB3BvIlkmkbTKgNjM5t/MhbJgWCphEjjQrIEi2E9SboPcM8KJL IZhLk+CefZMj7CrpSU5fli1qi+KzlwIBKrBcCrHJnVQpo6C1cUKBH9b/s9KZGXxw 5CdudQ4oY1zUxBYisZ5MHamkHr8krTIeCAFkmgf/f4C6reV3YkFA9UOp8978Pb9v MhTgiKiRrGvDEpN9GKgCzLkILrdQhDSUKTnA4EH6AcZ8WhSyD3geeaMMGNzAmfwr FOIHEPfeO1qIYfCxYO84hTxkG5Jx7auap+jYVU807NsJJUslkz2bCnguGunHE26p hNMgq2LlIooC9ius0CUCF3iULVakuyy+PqbeiCZsqDnVoQSlb/JWpUmNiRBechXC v5WR5DowSM38Q+Trc+5NuqHnC6WPOIPU/ZPF0SoSDsX/tIAJjuI= =WFQj -----END PGP SIGNATURE----- --=-=-=--