Hello Guixers,

I need some help, please. I’m having trouble with the PostgreSQL service
in a Guix System container. A few months ago, I had issues with the
system-log service (see my previous post below). I tried again today,
and I think the issue with system-log has been recently fixed—it’s now
working!

However, I’m encountering a new problem: the offending service is now
the loopback service. I can’t get it to work in my system container, and
the PostgreSQL service depends on the loopback service to start.

I believe that a new Linux network namespace already provides a loopback
interface, so it’s not necessary for Guix to create it again. That’s why
the loopback service (part of base-services) fails, and as a result, the
PostgreSQL service doesn’t start. Does that make sense?

Can anyone help me figure out why I can’t start my PostgreSQL service in
the Guix container (exactly as described in the Guix cookbook)?

Best regards,


Antonio Carlos Padoan Junior <acpadoa...@yahoo.com.br> writes:

> Hi guix,
>
> I'm having a problem with guix system containers, but not sure if it a
> bug or mis-configuration. I can't start postgres shepherd service
> because system-log service is not starting. A permission issue on the
> container:
>
> Status of system-log:
>   It is stopped (failing).
>   It is enabled.
>   Provides: system-log syslogd
>   Requires: root-file-system
>   Will not be respawned.
>   Failed to start at 14:40:52 (27 seconds ago).
> root@container /# herd start system-log
> herd: error: exception caught while executing 'start' on service 'system-log':
> In procedure open-fdes: Operation not permitted
>
> How to debug it? Someone can help me? I tried creating the container
> without any sharing and sharing different host folders. The issue remains
> always the same.
>
> Best regards,
>
> Antonio Carlos Padoan Junior <acpadoa...@yahoo.com.br> writes:
>
>> Hi,
>>
>> I hope I'm not spamming here.
>>
>> I'm trying to set up a PostgreSQL system container, starting exactly
>> from the example in the Guix cookbook. Unfortunately, the container's
>> Shepherd instance doesn't seem to activate the service — PostgreSQL is
>> marked as enabled but remains stopped. If I try to restart, it
>> freezes. I'm not sure how to debug it. Actually I can launch manually
>> the server once inside the container, but not from shepherd.
>>
>> Here is the log output when the container is launched:
>>
>> #+begin_example
>>     system container is running as PID 26982
>>     WARNING: (guile-user): imported module (guix build utils) overrides 
>> coreRun 'sudo guix container exec 26982 /run/current-system/profile/bin/bash 
>> --login'
>>     or run 'sudo nsenter -a -t 26982' to get a shell into it.
>>     
>>     binding `delete'
>>     WARNING: (guile-user): imported module (guix build utils) overrides core 
>> binding `delete'
>>     making '/gnu/store/vhw97fjjqx3pnnb7majczjh2dnv9qcrq-system' the current 
>> system...
>>     populating /etc from /gnu/store/9vjv5vpgmws775hhzyfnpinghy9sjdbn-etc...
>>     WARNING: (guile-user): imported module (guix build utils) overrides core 
>> binding `delete'
>>     WARNING: (guile-user): imported module (guix build utils) overrides core 
>> binding `delete'
>>     setting up privileged programs in '/run/privileged/bin'...
>>     WARNING: (guile-user): imported module (guix build utils) overrides core 
>> binding `delete'
>>     Please wait while gathering entropy to generate the key pair;
>>     this may take time...
>>     The files belonging to this database system will be owned by user 
>> "postgres".
>>     This user must also own the server process.
>>     
>>     The database cluster will be initialized with locale "en_US.utf8".
>>     The default database encoding has accordingly been set to "UTF8".
>>     The default text search configuration will be set to "english".
>>     
>>     Data page checksums are disabled.
>>     
>>     fixing permissions on existing directory /var/lib/postgresql/data ... ok
>>     creating subdirectories ... ok
>>     selecting dynamic shared memory implementation ... posix
>>     selecting default max_connections ... 100
>>     selecting default shared_buffers ... 128MB
>>     selecting default time zone ... Europe/Oslo
>>     creating configuration files ... ok
>>     running bootstrap script ... ok
>>     performing post-bootstrap initialization ... sh: line 1: locale: command 
>> not found
>>     2025-04-22 10:23:14.372 CEST [20] WARNING:  no usable system locales 
>> were found
>>     ok
>>     syncing data to disk ... ok
>>     
>>     initdb: warning: enabling "trust" authentication for local connections
>>     You can change this by editing pg_hba.conf or using the option -A, or
>>     --auth-local and --auth-host, the next time you run initdb.
>>     
>>     Success. You can now start the database server using:
>>     
>>     /gnu/store/7dqxc5rizlqyc1s7frbnzd8wnbfpd2v6-postgresql-14.13/bin/pg_ctl 
>> -D /var/lib/postgresql/data -l logfile start
>>     
>>     shepherd[1]: GNU Shepherd 1.0.3 (Guile 3.0.9, x86_64-unknown-linux-gnu)
>>     shepherd[1]: Starting service root...
>>     shepherd[1]: Service root started.
>>     shepherd[1]: Service root running with value #<<process> id: 1 command: 
>> #f>.
>>     shepherd[1]: Service root has been started.
>>     shepherd[1]: starting services...
>>     shepherd[1]: Configuration successfully loaded from 
>> '/gnu/store/bvjlvrpqss4rqp7wgidj5w1v9zzk11w4-shepherd.conf'.
>>     shepherd[1]: Starting service user-file-systems...
>>     shepherd[1]: Starting service root-file-system...
>>     shepherd[1]: Starting service host-name...
>>     shepherd[1]: Starting service pam...
>>     shepherd[1]: Starting service sysctl...
>>     shepherd[1]: Starting service log-rotation...
>>     shepherd[1]: Starting service loopback...
>>     shepherd[1]: Service user-file-systems started.
>>     shepherd[1]: Service root-file-system started.
>>     shepherd[1]: Service host-name started.
>>     shepherd[1]: Service pam started.
>>     shepherd[1]: Service log-rotation started.
>>     shepherd[1]: Service user-file-systems running with value #t.
>>     shepherd[1]: Service user-file-systems has been started.
>>
>> #+end_example
>>
>> Can anyone help me debug it?
>>
>> Best regards,

-- 
Antonio Carlos PADOAN JUNIOR
PGP fingerprint:
243F 237F 2DD3 4DCA 4EA3  1341 2481 90F9 B421 A6C9

Reply via email to