Subject: [PATCH 2/2] guix-install.sh: Check the daemon 'nscd' and suggest it.

From: zimoun <[email-masked]>
Date: Fri, 2 Oct 2020 19:42:11 +0200

Fixes <https://bugs.gnu.org/43744>.

* etc/guix-install.sh (chk_sys_nscd): New function to check if the daemon
'nscd is running, otherwise suggest to install distribution-wide.
---
 etc/guix-install.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index a5da198eb0..3860ab3cdc 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -200,6 +200,18 @@ chk_sys_arch()
     ARCH_OS="${arch}-${os}"
 }
 
+chk_sys_nscd()
+{ # Check if nscd is up and suggest to start it or install it
+
+    if [ "$(type -P pidof)" ]; then
+        if [ ! "$(pidof nscd)" ]; then
+            _msg "${ERR}We recommand to install the daemon 'nscd' via your distribution..."
+            _msg "${ERR}...or to start it."
+            _msg "${ERR}Please read 'info guix \"Application Setup\"' about \"Name Service Switch\""
+        fi
+    fi
+}
+
 # ------------------------------------------------------------------------------
 #+MAIN
 
@@ -552,6 +564,8 @@ main()
     _msg "${INF}cleaning up ${tmp_path}"
     rm -r "${tmp_path}"
 
+    chk_sys_nscd
+
     _msg "${PAS}Guix has successfully been installed!"
     _msg "${INF}Run 'info guix' to read the manual."
 
-- 
2.28.0