From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 06 02:56:10 2018 Received: (at 33270) by debbugs.gnu.org; 6 Nov 2018 07:56:10 +0000 Received: from localhost ([127.0.0.1]:35959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJwDZ-0004KO-Vt for submit@debbugs.gnu.org; Tue, 06 Nov 2018 02:56:10 -0500 Received: from mail-io1-f52.google.com ([209.85.166.52]:38726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJwDY-0004KB-82 for 33270@debbugs.gnu.org; Tue, 06 Nov 2018 02:56:08 -0500 Received: by mail-io1-f52.google.com with SMTP id q18-v6so8548537iod.5 for <33270@debbugs.gnu.org>; Mon, 05 Nov 2018 23:56:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GGMbMND8pY7n3mtgBdlQFhaE3/wCv8SorDKNOBY+i+Q=; b=nWnZk3ujwcEStxoySMsLcMMQvhMkghdH5eaAK65bduVeKf4dFFpBpa3rYt2nfhGdCi fmxRR6bVYLjU3VKwytlaN6OGpFF33Ag/grTePe+JUYqszhvLljBc6jKKr/XhZ+e4l02M Q4j+qdBNQZKxvrGnLU2Fnj/80uqG+eYwQtvev49WR8bSA5GtM/sgd0SwTaK+LvIucdzp qhT9L+37yfqamXqZifist2AiPdc43DqDBdR2j2PaZwp+GikrH6qipRQLTTPYR6ieqsu0 owD5d44szlLPT2VAD5/E654vs+7dbbYWH/Uh68yV64/YelucMn9BzAdICAcy0ysVNLnA qtXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GGMbMND8pY7n3mtgBdlQFhaE3/wCv8SorDKNOBY+i+Q=; b=bmrTbhdGcSUiZhh8aHcxv7/vx3UJvV8Muc2AaLKMQjkCOFCGFKzsbHR66yCSYd/VLl mCP77VRoB91rV6jInkaCB/UI3CCcARBhmq4rpQnBp0y+Vq9cHPBjUEEK7YcvgnQgP32+ mfwkuvZ+JGcsi2CU+tPeU/Gt9wXWSk/fT/UICE0foUyPj1XJZOlNWiEuBo3pB2LXWy47 62PsA3z3YKrq85Dj2j1P2F7WbvR8W2ZgQ/azhDl3JjgLMdICrpmQjw8dwVAi22Qe5a48 M2aRaw6mU7CYXuFYgWwN5uBtP/uKXCAdM86dE9qJMT09b2/mDDZBEPjbDIdwVbxQGeun uMtw== X-Gm-Message-State: AGRZ1gJUrTOODKQV2GlvFz8zNGGP2R03Zj11DUsKNXsVxb9a0m8+Dn0h R78Nbw7sJ2Mir0g/23+QSuuQ5rV28ASozntLDTrtzhE= X-Google-Smtp-Source: AJdET5fzrhTMlRk3Ws8o3+jLtNvIOQSD4aimjXNJcMqto1lHO2EzOLI5uJLzls2cFXXGXGdovxMJEGQiN0FNORflx0I= X-Received: by 2002:a6b:e009:: with SMTP id z9-v6mr21179842iog.44.1541490962468; Mon, 05 Nov 2018 23:56:02 -0800 (PST) MIME-Version: 1.0 References: <87muqnwbj0.fsf@elephly.net> <20181105234944.305ce816@scratchpost.org> In-Reply-To: <20181105234944.305ce816@scratchpost.org> From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Date: Tue, 6 Nov 2018 08:55:49 +0100 Message-ID: Subject: Re: bug#33270: [SHEPHERD] Wrong error message when missing priviledge To: Danny Milosavljevic Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33270 Cc: Ricardo Wurmus , 33270@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Danny, Danny Milosavljevic ezt =C3=ADrta (id=C5=91pont: 2= 018. nov. 5., H, 23:49): > > Hi Gabor, > > On Mon, 5 Nov 2018 22:57:15 +0100 > G=C3=A1bor Boskovits wrote: > > > > sdb@komputilo ~$ herd status > > > > error: connect: /run/user/30011/shepherd/socket: No such file or di= rectory > > > > Actually this seems to be a message that can be translated to > > 'shepherd user instance is not running' am I correct? > > Yes, that's what it means. For a UNIX error message, what it's saying > is actually quite close to what it really means. :) > > I would suggest to keep the file name in the error message anyway, > but no harm in adding some extra information (it will slightly complicate > the socket discovery code, but that's okay. Also, right now profiles can > actually set up XDG_RUNTIME_DIR to point somewhere else and make herd con= nect > to the profile's shepherd's socket - which is nice, but is not really a *= user" > shepherd then anymore). > > Also, we should suppress the stack trace for this specific error since it > really doesn't add anything useful. > > > > The error could be that either the user=E2=80=99s instance is not run= ning or > > > that the user meant to communicate with the init system. It is not > > > obvious to me how to distinguish these two errors. > > I don't think it's possible to distinguish these. > > It would be possible to make herd fallback to the system shepherd if it c= an't > find the stuff in the user shepherd, but I'm not sure I'd like it. I would not like this either. > > Better, we could add "--user" and "--system" options to force herd to con= nect to > some specific shepherd regardless of user, at the cost of hard-coding tha= t there > are only these two (which is not actually the case - shepherd is meant to= be > used in a modular way and doesn't care one way or another how often and w= here > exactly you run it). Could we instead just give a hint like, "if you intended to communicate wit= h the system shepherd, please specify -s system_sepherd_socket_name_here on you command"? > > It's kinda weird to have different endpoints depending on whether one is = root or > not, but as a default it has precedent in both dbus and systemd. > > I think people can get used to it (we should document it).