diff mbox series

[bug#43769,2/2] guix-install.sh: Check the daemon 'nscd' and suggest it.

Message ID 20201002174211.14467-1-zimon.toutoune@gmail.com
State Accepted
Headers show
Series guix-install.sh: Minor first user-experience tweaks | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Simon Tournier Oct. 2, 2020, 5:42 p.m. UTC
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 mbox series

Patch

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