Subject: Re: [bug#77413] [PATCH] services: postgresql-service-type: Allow allowing to log into the user.
From: Ludovic Courtès <[email-masked]>
To: Tomas Volf <[email-masked]>
Cc: [email-masked], Maxim Cournoyer <[email-masked]>
Date: Wed, 23 Apr 2025 12:07:17 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

Ludovic Courtès <[email-masked]> writes:

> But then again, I’m not a sysadmin; if you say that this is common
> practice in the case of the postgresql privilege separation user, then
> it’s probably that people consider it good enough, and perhaps we don’t
> need a warning.

Based on this, I went ahead and applied the patch with the change below.

Thanks,
Ludo’.

diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm
index b45aad2c0b..edc3198ad5 100644
--- a/gnu/services/databases.scm
+++ b/gnu/services/databases.scm
@@ -29,6 +29,7 @@ (define-module (gnu services databases)
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
   #:use-module (gnu system shadow)
+  #:autoload   (gnu system accounts) (default-shell)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages base)
   #:use-module (gnu packages databases)
@@ -220,7 +221,7 @@ (define (create-postgresql-account config)
                 (not (string=? home-directory %default-home-directory)))
                (home-directory home-directory)
                (shell (if allow-login?
-                          ((@ (gnu system accounts) default-shell))
+                          (default-shell)
                           (file-append shadow "/sbin/nologin"))))))))
 
 (define (final-postgresql postgresql extension-packages)