From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id QMQDL+DZhV/SMgAA0tVLHw (envelope-from ) for ; Tue, 13 Oct 2020 16:46:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0OC/KuDZhV84MwAAB5/wlQ (envelope-from ) for ; Tue, 13 Oct 2020 16:46:24 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A4B529402C2 for ; Tue, 13 Oct 2020 16:46:22 +0000 (UTC) Received: from localhost ([::1]:54564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSNRM-0001kc-SW for larch@yhetil.org; Tue, 13 Oct 2020 12:46:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSNR4-0001jq-U2 for guix-patches@gnu.org; Tue, 13 Oct 2020 12:46:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSNR4-0005Je-Cr for guix-patches@gnu.org; Tue, 13 Oct 2020 12:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kSNR4-00034n-BH for guix-patches@gnu.org; Tue, 13 Oct 2020 12:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43769] [PATCH v2 2/2] guix-install.sh: Check the service 'nscd' and suggest it. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Oct 2020 16:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43769 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Tobias Geerinckx-Rice Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 43769@debbugs.gnu.org Received: via spool by 43769-submit@debbugs.gnu.org id=B43769.160260752911784 (code B ref 43769); Tue, 13 Oct 2020 16:46:02 +0000 Received: (at 43769) by debbugs.gnu.org; 13 Oct 2020 16:45:29 +0000 Received: from localhost ([127.0.0.1]:48633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSNQW-00033z-KV for submit@debbugs.gnu.org; Tue, 13 Oct 2020 12:45:28 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:34781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSNQU-00033m-EQ for 43769@debbugs.gnu.org; Tue, 13 Oct 2020 12:45:26 -0400 Received: by mail-wm1-f66.google.com with SMTP id l15so344361wmh.1 for <43769@debbugs.gnu.org>; Tue, 13 Oct 2020 09:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=8Jg4cvtZdD7l0UT+xyfxq2OpF7/b5b0xXMWXvlpTYI4=; b=MyFOJplsZ9/VO0hu6NP+mRtScWkDs0QI5yw7gL1+r/oZICFL8y1qY3V1FAN2XSzguF Q8wwXYTJgLqaCBJFGR07TmYeTdOYuQCi1i/cmpQhPaEkzk2pzI5K3/nYBttBOTYb1/ZJ 6j4OME/yqCjJTM34Sorlz4rNuBesDNGz2XpSbAVyYzCw3HRuHcjbk7YsChCo32xPJf0Y QaN29fJsCme+Jg+hSAZdZpBiQSoV9N3Uf1Q0HLHmF6uuoSw54sXPg0kMWxbfVPrXeWDm KPnGVqG8j9tbPmo71JQhAy9ttgetisfxrRK9UI+///AOcIMG9tDAK8GqHQI/4k5f8D3G F0Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=8Jg4cvtZdD7l0UT+xyfxq2OpF7/b5b0xXMWXvlpTYI4=; b=PRjjJmPDLgtBsniLKPylXoryFnfFI5x2SzLp+AHhgwDAKmUaUzy6wwjrqa1jCTXCve tPRxZEb6+p9+R/IjsFn3NqoTWRxOd/5rlh9hIXCKks6keK8FbwoHZqZtummC2aam1AVS 2zULgDAV4LfeK4ZYoADPWaHTS2x5sx7vCed64sSMFXvYhJKyG1Ej/uwR4BYCkhs5VxG2 Q13TRNEor0HbJL+n7RWEU2gWnngZi+9RCXKqoS4YVdqoV/8kV+2H2XbrqNjZqoyeNy07 d/ncylhbI5nn6JZ0V9akjpCkv+7UozKvj7HP7s/PH50TeTKmSrpQIzcfIaQW7TB84hu1 mkKA== X-Gm-Message-State: AOAM5327nGuo3lDD+seOUQ081R5W94xe3QjniW3+ZrIxw3b+/6ZTcSH0 XmheUbasRHrOSdo5ldtmP37kktUs6/s= X-Google-Smtp-Source: ABdhPJwGI2dC6+FpnOSP2M93Bgzd08lj2VqCSFOaKHgagHo2gUqKkz3AaGvQE/k5c2GNFiNqGBTbgw== X-Received: by 2002:a1c:bcd5:: with SMTP id m204mr717514wmf.133.1602607520092; Tue, 13 Oct 2020 09:45:20 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id f7sm175215wrx.64.2020.10.13.09.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 09:45:19 -0700 (PDT) From: zimoun References: <20201003184447.9542-1-zimon.toutoune@gmail.com> <20201003184447.9542-2-zimon.toutoune@gmail.com> <87mu139l5e.fsf@nckx> <87lfgl5c3f.fsf@gnu.org> <878sckambe.fsf@nckx> Date: Tue, 13 Oct 2020 18:45:16 +0200 In-Reply-To: <878sckambe.fsf@nckx> (Tobias Geerinckx-Rice's message of "Mon, 05 Oct 2020 14:28:53 +0200") Message-ID: <86o8l6jcrn.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=MyFOJpls; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: IdtCWTxBgRDh >> In practice, you enable nscd by running =E2=80=98apt install nscd=E2=80= =99 or similar, >> and I think we cannot guess what the right command is. WDYT? > > I agree: I was under the assumption that nscd is commonly installed as pa= rt of > the base OS, but disabled by default at the init system level. If that's= not > likely to be true, don't let's bother. >> ask and then try to start the service depending on the init system if ns= cd >> is not running > > If the distro equivalent of =E2=80=98service start nscd=E2=80=99 works in= the *common* case, I > like it. Otherwise a warning/suggestion to manually install & enable it = is > fine. > > My general point was that guix-install.sh should do as much as it can wit= h the > information it already has ($INIT_SYS) and be consistent in using it, not= that > we start sniffing $LEGACY_PKG_MANAGER too :-) As said, I have tried somehting like this uglyness=E2=80=A6 but it=E2=80=99= s wrong! It is overcomplicated and if the package is installed, then it is highly probable that is running. I mean 2 kind of users: - the noob as me: =E2=80=9CPlease install nscd=E2=80=9D and the I do =E2= =80=9Captitude install nscd=E2=80=9D and my distro takes care of everything (start it etc.) =20=20=20 - the control-freak: they knows what to do with the message =E2=80=9CPlease install nscd=E2=80=9D. And we can try to guess the distro=E2=80=A6 but again it is overcomplicated. So it=E2=80=99s not useful. A message is enough. Please give a look at v3. Thanks, simon --8<---------------cut here---------------start------------->8--- sys_enable_nscd() { # Check if nscd is up and suggest to start it or install it flag=3D"" if [ "$(type -P pidof)" ]; then if [ ! "$(pidof nscd)" ]; then _msg "${INF}We recommend installing and/or starting your distri= bution 'nscd' service" while true; do read -p "Permit to try starting your 'nscd' service? (yes/n= o) " yn case $yn in [Yy]*) case "$INIT_SYS" in upstart) { initctl reload-configuration; /etc/init/ && start nscd; } && _msg "${PAS}enabled 'nscd' service v= ia upstart" ;; systemd) if [ ( systemctl daemon-reload && systemctl enable nscd && systemctl start nscd; ) ]; th= en _msg "${PAS}enabled 'nscd' service v= ia systemd"; else flag=3Dfailure fi ;; sysv-init) { update-rc.d nscd defaults && update-rc.d nscd enable && service nscd start; } && _msg "${PAS}enabled 'nscd' service v= ia sysv" ;; openrc) { rc-update add nscd default && rc-service nscd start; } && _msg "${PAS}enabled 'nscd' service v= ia OpenRC" ;; NA|*) _msg "${ERR}unsupported init system; run= the 'ncsd' service manually" ;; esac; break;; [Nn]*) _msg "${INF}Skipped 'nscd' service" flag=3Dfailure break;; *) _msg "Please answer yes or no."; esac done fi else _msg "${WAR}We cannot determine1 if your distribution 'nscd' servic= e is running" failure=3Dfailure fi if [[ $flag =3D=3D failure ]]; then _msg "${WAR}Please read 'info guix \"Application Setup\"' about \"N= ame Service Switch\"" fi } --8<---------------cut here---------------end--------------->8---