unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Dependencies between service extensions
@ 2020-06-07 15:43 conjaroy
  2020-06-23 12:53 ` conjaroy
  2020-06-23 21:51 ` Marius Bakke
  0 siblings, 2 replies; 4+ messages in thread
From: conjaroy @ 2020-06-07 15:43 UTC (permalink / raw)
  To: help-guix

Greetings help-guix,

I've been a casual user of Nix for a couple of years and have decided to
test the waters with Guix. While I'm looking forward to spending time with
Lisp after many years away, my biggest impression is that Guix seems to
have well-documented interfaces in cases where Nix relies more on loose
conventions.

After reviewing the manual and some of the service definitions, I'd like a
better understanding of how to implement a common pattern. Let's say that I
have some application Foo that uses an external system for persistence,
like a SQL database. Before starting up service Foo I need to ensure both
that the database service is running and that the database instance for Foo
has been initialized, because Foo doesn't know how to initialize the
database on its own.

The first issue (how to ensure that the database service is up) seems to be
solved by adding a shepherd-root-service-type service extension that
declares a set of "requirements". And the second issue (performing
pre-startup initialization) seems to be handled by the
activation-service-type extension. So far so good.

But I couldn't find documentation on whether service activation scripts can
safely rely on other services that happen to be declared as requirements in
the shepherd-root-service-type extension. And while I found many activation
scripts that do simple things like modifying the filesystem, I couldn't see
any that interact directly with other services. However, I did see some
evidence of service extensions relying on the side effects of other service
extensions: a number of activation scripts call "getpwnam" for info on
system accounts that could exist only if the corresponding
account-service-type extension has already been executed.

So my questions are: could someone clarify best practices for initializing
state in Service A before Service B starts up? And is there anything about
the ordering/dependencies of a service's extensions that could be better
documented in the manual?

Thanks for all of your work on this project.

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-30 23:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-07 15:43 Dependencies between service extensions conjaroy
2020-06-23 12:53 ` conjaroy
2020-06-23 21:51 ` Marius Bakke
2020-06-30 23:11   ` conjaroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).