Hi Gendre, 

On June 10, 2025 12:14:16 AM GMT+02:00, "Sébastien Gendre" <[email protected]> wrote:
>Hello,
>
>I am very new to Guix system. I have read the documentation and seen a
>few videos, but their is some parts about the service that I did not
>understand, or I am not sure to understand. And I have some questions.
>
>1) Is their a difference between a service put in the `operating-system'
>   declaration and the service managed by Shepherd ?
>

Yes, although both are called services, the system services arent necessarily 
daemons. The os services extend other services, going to activation service at 
the top (it is a tree), this is basically a script for activating the system - 
putting files to correct places etc. You can see this tree using guix system 
graph. 

System services extending shepherd root service will provide daemons for 
shepherd to run, and in turn these extensions are written into a guile config 
that shepherd can understand to run the services. 


>2) With services put in the `operating-system' declaration: If I
>   understand it, we define instances of a service built from a service
>   type ?

Yes, service type and value (for configuration) 

>
>3) If yes to question 2, then we can declare multiple instance of a same
>   type of service ? Like multiple instance of a game server ?

You cannot use the same type twice. 

If you want multiple instances of a game server, either you need to make 
multiple service types, or the service type you have needs to support multiple 
instances, ie. Accepting an array of configurations and making shepherd 
services out of all of them, inside that one os service. 

There are other workarounds such as running system containers or vms. 

>
>4) If yes to question 3, then how about services who can only have one
>   instance ? Is there a way to easily identify them ?

All have at most one instance in a given operating system

>
>5) If I put a service in the `operating-system' declaration, how can
>   I start/stop it ? And if their is multiple instance, how are they
>   differentiated ?

OS services arent started/stopped. To use them, you reconfigure or boot (on 
every boot the activation is ran) 

>
>6) When defining a new service type, it can extend other service(s). But
>   why do the example in the documentation expend a service type ?

Service type is extended, not service, as service also contains the value of 
the service, you aren't extending a given value, but just the type. 

>
>7) With services put in the `operating-system' declaration: If I
>   understand it, they follow an object oriented logic ? Each service is
>   an object, built from a class (service type), that can receive init
>   values (its config) and the classes inherit from other class(es) ?

Those are records, I wouldn't really say they are classes. There isn't really a 
concept of inheritance as with classes in oop languages. You can use inherit, 
but it is just copying the fields from the record you specify, as default 
values to the fields of your new instance of record. 

>
>
>I'm sorry if my questions seems to have obvious answers to experimented Guix
>system users. I'm very new to Guix system. Until now, I've mostly
>explored the Guix package manager.
>
>
>Best regards
>
>-------
>Gendre Sébastien

Rutherther 

Reply via email to