From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id uE68BQaUVmUBWAEA9RJhRA:P1 (envelope-from ) for ; Thu, 16 Nov 2023 23:13:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id uE68BQaUVmUBWAEA9RJhRA (envelope-from ) for ; Thu, 16 Nov 2023 23:13:26 +0100 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 B96B35C5E2 for ; Thu, 16 Nov 2023 23:13:25 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=FqdKQX7g; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1700172805; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=C5M0S8fIwJoUvV9CJLfd0lxcE47mcncyTSq5AwsPEGg=; b=CktGgNgqfnK2Is9H4ODtXZ9b20n7XG61z5zE/luDjh9AlB1y2h06a99P8TM9rI/NoY9Mnv UJ1fEJgsnI3IwM//2eu/f7lBoqlqGw41ylaoGoTzixKY5HrBeze/e800gOCK55CqJXMiBT 4ZkGs1Cj2RLyCqzyeOOoypNwzaMNngV9l6OVnKPiKeFzUTyw4t0P9Yxs7ZBWXbOGmCwEXB 8CjhcBWghSSalaW01YH3qULL5SU33Ng+yfUHEylBL90vh9BMkCPE2dQeRYG6ZFb6ZWEf+w 5Wp7+uGrrHvKPTRAwoLAa0ko5zwqrUcbPFx+G3/oybI7x1zHnZzQMa5meLiRlQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=FqdKQX7g; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1700172805; a=rsa-sha256; cv=none; b=hus7xhR6cgQLcaTtNpx8rh8VZ0q1PKKEt5Nmlay+qqANy6mvU49nxQNflZAT/6XaHp1qVs oZcWCIwA3laVrQiho3YbOTvANG0A8T7f5CAE4G7hWthZ70KCPuzzzzL79KabCHyOhlJC1U AMV8bRAjQQ5RarM03bxHkI2oNXJsCfsJ6fcSHM4N6BnzmKGqrMIsEaW1EUBFdp+WtokSLt Z5op54j13ydQywJqJ9sLTio29JoNTvwkdB1l2NQTvkIkbXPxIFwraBDtJfGXjZaAw+ldyp BMW2Iz/xo1QIol/FTQ2nF7clOTWSgsjIwNWDQpabGpg7eOdXymjD/ofi+xWjNw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3kCQ-0006Wv-Qp; Thu, 16 Nov 2023 16:46:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3igd-0002RG-87 for bug-guix@gnu.org; Thu, 16 Nov 2023 15:10:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3igc-0005WU-V2 for bug-guix@gnu.org; Thu, 16 Nov 2023 15:10:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3igc-0005EV-G5 for bug-guix@gnu.org; Thu, 16 Nov 2023 15:10:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#65463: Herd `fport_write: Broken pipe` error when running `guix home reconfigure` References: <169277323322.1687.15739147838600524142@localhost> In-Reply-To: <169277323322.1687.15739147838600524142@localhost> Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 16 Nov 2023 20:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65463 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 65463@debbugs.gnu.org Received: via spool by 65463-submit@debbugs.gnu.org id=B65463.170016536320058 (code B ref 65463); Thu, 16 Nov 2023 20:10:02 +0000 Received: (at 65463) by debbugs.gnu.org; 16 Nov 2023 20:09:23 +0000 Received: from localhost ([127.0.0.1]:44669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3ifz-0005DS-4O for submit@debbugs.gnu.org; Thu, 16 Nov 2023 15:09:23 -0500 Received: from mail-108-mta175.mxroute.com ([136.175.108.175]:33875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3ift-0005DF-5w for 65463@debbugs.gnu.org; Thu, 16 Nov 2023 15:09:21 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta175.mxroute.com (ZoneMTA) with ESMTPSA id 18bd9c088ef000190b.001 for <65463@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 16 Nov 2023 20:09:15 +0000 X-Zone-Loop: 231813f32779144987b667ce6cc3daf4b64fb3d95448 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:Content-Type: Message-ID:Subject:To:From:Date:MIME-Version:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=C5M0S8fIwJoUvV9CJLfd0lxcE47mcncyTSq5AwsPEGg=; b=FqdKQX7g2bLqd78BPchIvmQkgB bTnqmZtoDN5fAPmmlpCHr1P7GvtPeYl/LYbXZD0ljCu9eEbFNQLp7RDktClNzNkDOSOSUyMxjFF/F huCZs4cOBfbQJ0Jq99YA2wcs+dPYn8GjUIxXFZQbAF0/yEkbqJk9QO2zsEN0tALCs5+2VIEBcZyqs gTCf2fbuyROb7LNYYU9SX4ouYXolB/Cr8HH+exOKhM09zQr8KIwbGfZnaVhH9N3x8F9UmWUPraihn rosTkJ8aF8bLHUd2Ar++a1W0DcNxyK9cCd2ZYTZ0FLsCq+4Q/svMKrQMq/jYZ+hEMYMuI6QCofPle ArczWXBQ==; MIME-Version: 1.0 Date: Thu, 16 Nov 2023 15:09:13 -0500 From: Richard Sent Message-ID: <5538caef3f592a7adc5b75e1cb99a711@freakingpenguin.com> X-Sender: richard@freakingpenguin.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Id: richard@freakingpenguin.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Thu, 16 Nov 2023 16:46:55 -0500 X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.09 X-Spam-Score: -6.09 X-Migadu-Queue-Id: B96B35C5E2 X-Migadu-Scanner: mx13.migadu.com X-TUID: vfrSLbFVvmCE Did some more testing and I was able to find a workaround for my version of this issue, although I don't know if it'll solve it for others. TL;DR is I changed my login shell from fish back to bash. The system configuration for the nonworking machine was using fish `(user-account (shell (file-append fish "/bin/fish") ...)`. There seems to be some unintended behavior with executing the `on-first-login` script in `.profile` using fish. The stock `config.fish` sources $HOME/.profile, which executes the .guix-home/on-first-login script via fenv source $HOME/.profile. Herd seems to start up nicely, but somehow stdout for herd winds assigned to a pipe without a reader between initialization and spawning gpg-agent. initialization writes to the logfile just fine regardless of if you're using fish or bash: --8<---------------cut here---------------start------------->8--- 2023-11-16 14:17:15 Starting service root... 2023-11-16 14:17:15 Service root started. 2023-11-16 14:17:15 Service root running with value #t. 2023-11-16 14:17:15 Service root has been started. 2023-11-16 14:17:15 Daemonizing... 2023-11-16 14:17:15 Restarting signal handler. 2023-11-16 14:17:15 Now running as process 936. 2023-11-16 14:17:15 Starting services... 2023-11-16 14:17:15 Configuration successfully loaded from '/gnu/store/kzh1x4y030drw0jrdk08nynvvyasm3c1-shepherd.conf'. 2023-11-16 14:17:15 Starting service gpg-agent... 2023-11-16 14:17:15 Service gpg-agent has been started. 2023-11-16 14:17:15 Service gpg-agent started. 2023-11-16 14:17:15 Service gpg-agent running with value (("ssh" . #) ("browser" . #) ("extra" . #) ("std" . #)). 2023-11-16 14:17:15 Successfully started 2 services in the background. --8<---------------cut here---------------end--------------->8--- When using bash instead of fish, stdout (file descriptor 1) points to /dev/null so the write does not fail. Another write is for $HOME/.local/state/shepherd.log. bash fds --8<---------------cut here---------------start------------->8--- $ ls -l /proc//fd) lr-x------ 1 richard users 64 2023-11-16 14:17 0 -> /dev/null l-wx------ 1 richard users 64 2023-11-16 14:17 1 -> /dev/null l-wx------ 1 richard users 64 2023-11-16 15:04 2 -> /home/richard/.local/share/sddm/xorg-session.log l-wx------ 1 richard users 64 2023-11-16 14:17 6 -> /home/richard/.local/state/log/shepherd.log // ... --8<---------------cut here---------------end--------------->8--- bash login shell strace of herd, right after running $ gpg --card-status: --8<---------------cut here---------------start------------->8--- write(1, "Spawning systemd-style service /gnu/store/2zgdxhbnkz8fgsb1l4xydm3nbvj66mih-gnupg-2.2.39/bin/gpg-agent.\n", 103) = 103 newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0444, st_size=3536, ...}, 0) = 0 write(6, "2023-11-16 14:36:29 Spawning systemd-style service /gnu/store/2zgdxhbnkz8fgsb1l4xydm3nbvj66mih-gnupg-2.2.39/bin/gpg-agent.\n", 123) = 123 // happy success messages --8<---------------cut here---------------end--------------->8--- However, when fish is in charge of executing on-first-login, stdout and stderr for the user shepherd get directed to a pipe instead of /dev/null. fish fds, both stdout and stderr point to a pipe: --8<---------------cut here---------------start------------->8--- $ ls -l /proc//fd) lr-x------ 1 richard users 64 2023-11-16 14:47 0 -> /dev/null l-wx------ 1 richard users 64 2023-11-16 14:47 1 -> pipe:[41039] l-wx------ 1 richard users 64 2023-11-16 14:47 2 -> pipe:[41039] l-wx------ 1 richard users 64 2023-11-16 14:47 6 -> /home/richard/.local/state/log/shepherd.log // ... --8<---------------cut here---------------end--------------->8--- fish login shell strace of herd: --8<---------------cut here---------------start------------->8--- 21:46:43 write(1, "Spawning systemd-style service /gnu/store/2zgdxhbnkz8fgsb1l4xydm3nbvj66mih-gnupg-2.2.39/bin/gpg-agent.\n", 103) = -1 EPIPE (Broken pipe) --8<---------------cut here---------------end--------------->8--- Details of what processes are using the pipe: (i.e. nothing else is using the pipe. Which makes sense for a broken pipe error at least...) --8<---------------cut here---------------start------------->8--- $ lsof -n | grep -w 41039 (standard input):shepherd 991 richard 1w FIFO 0,14 0t0 41039 pipe (standard input):shepherd 991 richard 2w FIFO 0,14 0t0 41039 pipe --8<---------------cut here---------------end--------------->8--- What confuses me about this situation is judging from that bash behavior pipes shouldn't be involved at all for stdin/stdout/stderr. There's also an discrepancy in that stderr for bash points to xorg-session.log while for fish it points to the same pipe as stdout. It would be interesting to know if other users who are experiencing broken pipe errors are also using fish as their user shell.