From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: weird errors; shepherd Date: Wed, 24 Jan 2018 15:47:16 +0100 Message-ID: <87zi53xqiz.fsf@gnu.org> References: <87a7xhmpht.fsf@gnu.org> <20180114114346.78977872@scratchpost.org> <20180122115908.588a1d06@scratchpost.org> <20180122200146.545ef7f6@scratchpost.org> <20180123234318.3463d51d@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeMKh-0004sE-DP for guix-devel@gnu.org; Wed, 24 Jan 2018 09:47:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeMKe-00074B-84 for guix-devel@gnu.org; Wed, 24 Jan 2018 09:47:23 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:36978) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eeMKe-00073j-1K for guix-devel@gnu.org; Wed, 24 Jan 2018 09:47:20 -0500 In-Reply-To: <20180123234318.3463d51d@scratchpost.org> (Danny Milosavljevic's message of "Tue, 23 Jan 2018 23:43:18 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Danny Milosavljevic Cc: guix-devel Hello, Danny Milosavljevic skribis: > Everyone: > > After I've tried writing some shepherd service I have to say that writing= a > shepherd "start" action is way too difficult. > > Even now, I've not gotten to work: > > * Having the activation depend on any other service. I=E2=80=99m not sure what you mean. There=E2=80=99s no notion of dependenc= ies among activation snippets, let alone between activation snippets and service starts (when booting, activation snippets run *before* shepherd is started). Perhaps there=E2=80=99s a misunderstanding here? > * Logging errors from start-trytond to stderr or stdout. You can write: (make-forkexec-constructor =E2=80=A6 #:log-file "/var/log/something.log") which will redirect stdout/stderr to that file (info "(shepherd) Service De- and Constructors"). Now, I think stdout/stderr should be captured by default, and perhaps made available with a journalctl-like interface (Leo proposed a GSoC project along these lines.) > As far as I understand make-forkexec-constructor takes special care not > to kill stderr. As long there's no log-file specified it should leave = stdout > and stderr alone. So where does the text go? To PID 1=E2=80=99s stdout/stderr, i.e., /dev/console (which sucks). > I've had other problems like: > > * root's shepherd hangs sometimes and herd can't connect to it anymore. That=E2=80=99s a serious bug. Can you reproduce it? > * When I use (error "XXX") in a shepherd start block, booting the system > drops me into a REPL and doesn't let me out again (instead of just failing > this one service and continuing to boot). That=E2=80=99s inconvenient but =E2=80=9Cexpected=E2=80=9D in the sense tha= t the =E2=80=98start=E2=80=99 method is called right from shepherd.conf. Perhaps we should call =E2=80=98start= =E2=80=99 at a later stage. As you write, the Shepherd leaves quite a bit to be desired. The good news is that it=E2=80=99s a very small code base, so I=E2=80=99d encourage = people to look at it when they find something they=E2=80=99re dissatisfied with, and = see how it can be improved. Thanks, Ludo=E2=80=99.