Hi Guix,

Following my previous attempt at running a web service using Gunicorn and a 
SQLite database [1],
I tried to replace the SQLite database with a Posgresql database, for I thought
it would be easier! Silly me! 😅

[1]: https://lists.gnu.org/archive/html/help-guix/2026-03/msg00063.html

I’m now running into a totally different problem, but this time it might be that
I’m not using Guix service types as they are intended to be…

In my OS definition, which I use to instantiate a container, I add two services:

- a postgresql service
- a gunicorn service

The containers start and both services run, but… my problem arises when I try to
initialize the database, *ie* create the tables within it.
My web service has a command for that (two actually, `db init` or `db migrate`) 
and,
based on what I have understood, I run those commands from a 
`activation-service-type`
service extension.
The problem is that it runs **before** the database has been started and fails! 
😱

I do not "own" the `gunicorn-service-type` and cannot add a `requirement` to its
shepherd extension to tell it that it should run after the database.

Am I using the service types all wrong? Is the activation service the right 
place to
run init commands? Does `gunicorn-service-type` need to expose a `requirement`?
So many questions!! 😵

Any advice welcome!

--
Tanguy

Reply via email to