diff mbox series

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

Message ID 20201013171204.14708-1-zimon.toutoune@gmail.com
State Accepted
Headers show
Series [bug#43769,v3,1/2] guix-install.sh: Add symbolic links for supported shell completions. | expand

Checks

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

Commit Message

Simon Tournier Oct. 13, 2020, 5:12 p.m. UTC
Fixes <https://bugs.gnu.org/43744>.

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

Comments

Ludovic Courtès Oct. 16, 2020, 9:39 a.m. UTC | #1
Hello,

zimoun <zimon.toutoune@gmail.com> skribis:

> Fixes <https://bugs.gnu.org/43744>.
>
> * etc/guix-install.sh (chk_sys_nscd): New function to check if the service
> 'nscd is running, otherwise suggest to install distribution-wide.

[...]

> Fixes <https://bugs.gnu.org/43744>.
>
> * etc/guix-install.sh (sys_create_shell_completion): New function to add
> system wide all the symlinks for supported shell completions.

Applied, thanks!

Ludo’.
diff mbox series

Patch

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index f51a1b653f..7f0dd00e53 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -55,6 +55,7 @@  REQUIRE=(
 
 PAS=$'[ \033[32;1mPASS\033[0m ] '
 ERR=$'[ \033[31;1mFAIL\033[0m ] '
+WAR=$'[ \033[33;1mWARN\033[0m ] '
 INF="[ INFO ] "
 
 DEBUG=0
@@ -200,6 +201,19 @@  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 "${WAR}We recommend installing and/or starting your distribution 'nscd' service"
+            _msg "${WAR}Please read 'info guix \"Application Setup\"' about \"Name Service Switch\""
+        fi
+    else
+        _msg "${INF}We cannot determine if your distribution 'nscd' service is running"
+        _msg "${INF}Please read 'info guix \"Application Setup\"' about \"Name Service Switch\""
+    fi
+}
+
 # ------------------------------------------------------------------------------
 #+MAIN
 
@@ -523,6 +537,7 @@  main()
     chk_gpg_keyring
     chk_init_sys
     chk_sys_arch
+    chk_sys_nscd
 
     _msg "${INF}system is ${ARCH_OS}"