unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Catonano <catonano@gmail.com>
To: Christopher Baines <mail@cbaines.net>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: code review
Date: Sun, 24 Dec 2017 09:28:44 +0100	[thread overview]
Message-ID: <CAJ98PDwgLasoGcEo6c-VRzM9P5P3nC7thL=PN4KBrykaiUhfNg@mail.gmail.com> (raw)
In-Reply-To: <20170912203519.31bb6943@cbaines.net>

[-- Attachment #1: Type: text/plain, Size: 3129 bytes --]

2017-09-12 21:35 GMT+02:00 Christopher Baines <mail@cbaines.net>:

> On Mon, 11 Sep 2017 22:10:22 +0200
> Catonano <catonano@gmail.com> wrote:
>
> > I could use some code review on my Trytond service hypothesis
> >
> > As far as I understand, there are 2 steps that need to be done in
> > order for a Trytond service to be usable.
> >
> > 1) as the "postgres" role (that is as the operating system "postgres"
> > user), create a "tryton" role
> >
> > 2) as the tryton user (hence under the tryton role) run the Tryton
> > initialization script (trytond-admin -c <config file> -d <database
> > name> --all)
> >
> > I feel like I should extend the postgresql service in order to create
> > te trytond role but I don't know how
>
> I don't think there is any current approach for doing this.
>
> Service extension could be one way of doing it. It's similar to how
> other services in Guix interact with each other.
>
> However, I believe creating a role can only be done when the PostgreSQL
> server is running, which means that you'd need to defer creating the
> role until that point. Keeping this in a single shepherd service might
> not be easy to implement, and even if you did, there are some usability
> issues, e.g. if you add a new service to the system, and that service
> also extends PostgreSQL, then you might run in to trouble creating the
> role for the new service, without needlessly restarting the PostgreSQL
> service in the process.
>
> One approach I've implemented and used [1] is to do create roles for
> PostgreSQL when you start the service that uses that role.
>

Yes, I'll work on this approach from now on


>
> I also remember Ludo suggesting using additional services to handle
> this kind of setup, which I understood to be something like a
> tryton-postgresql-role shepherd service, which the tryton shepherd
> service would require.
>

I attempted this but my trytond-postgres-role-service-type doesn't extend
shepherd-root-service-type

I chose not to extend shepherd-root-service-type because the trytond role
doesn't require a daemon running
It has to be created one off (una tantum) so, I tought, a simple activation
will do

But now, the trytond-service-type (in charge of running the trytond daemon)
should require trytond-postgres-role among its dependencies but there is NO
sheperd service provisioning a postgres role

So this is what I end up with (when testing the system with the marionette
machinery)

srfi/srfi-1.scm:640:9: In procedure for-each:
srfi/srfi-1.scm:640:9: Throw to key `srfi-34' with args `(#<condition
&message [message: "service 'trytond' requires 'trytond-postgres-role',
which is not provided by any service"] 44bd120>)'.
make: *** [Makefile:5295: check-system] Error 1


Should I make the trytond-postgres-role a sheperd service ?
Admittedly I don't like the idea

So, I'm thinking, I'll get back to creating the postgres role upon
activation of the trytond-service-type

I failed to foresee this issue so I wasted some work :-/

The branch is here, should anyone want to take a look (pay attention, I
rebase carelessly)
https://gitlab.com/humanitiesNerd/guix-hacks

[-- Attachment #2: Type: text/html, Size: 4215 bytes --]

      parent reply	other threads:[~2017-12-24  8:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 20:10 code review Catonano
2017-09-12 19:35 ` Christopher Baines
2017-12-08 13:53   ` Catonano
2017-12-24  8:28   ` Catonano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ98PDwgLasoGcEo6c-VRzM9P5P3nC7thL=PN4KBrykaiUhfNg@mail.gmail.com' \
    --to=catonano@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=mail@cbaines.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).