From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id sLgGLCm/eGVmmwAAkFu2QA (envelope-from ) for ; Tue, 12 Dec 2023 21:14:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 8BkOKSm/eGXqIAAA62LTzQ (envelope-from ) for ; Tue, 12 Dec 2023 21:14:33 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=m05n28PQ; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702412073; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=V62GJQbCqX6shMmdG1VcWZhXGMBBfjYdvtInwqV9YRI=; b=DpLNKullhofF5VGXRq0XEcPbQS5siZa/7ULlsQ4qNX1781G+a7gzZB9lBSCJb73ve8GgmE 4EHzYj0Khxr5w6gzK3ZL0iCA5BKT0KV3/zAnbWjOhC5Cy4aV8DD2cFZl+CkOyZM9MjuoVS ut9IWd31CDiP1Fv1OjryggbvV6O2YNE5R8L2IEu68NJj0tEgri9re6Fg+1bnV8+nkvvJIx g9Ce0+ftQeSeI4aYWf8hp+5gw9F5eWVYHq9xm6S4aub1Y5jPZ6uFH9ONF9SfKj/YLx25dg J9/AViwLhgv/mLxmjVyXetGMLNFYw57LDdofqGBBsoqpI2jOkrp7fdacvsFz+A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702412073; a=rsa-sha256; cv=none; b=c+DVTQBCtWFp3sJ7EPuTb52hBfcEc8+bkraS3HI6CoX5vd68AfvMug6qAkwQB9UBRMffoa e/gjsgmhk0PG6hGzd5w7Xxdmq4Iey57t7eLWNiErnavfb22/6pCTX4ukSxNnmVAyXSRBzp cocFvRvpWZG7aA7xUErKczlHe9czl5BhrNt8efujjI3Eu6SCP8GslozdT5obsyXGgEVygj MG2lpb29/HIQWSK44WI/jelbtzsXO3i3ddkfEiJqZF0XNw7WdX682XTuxvd144dKcbhMnW q7wnwioLve5DsjN3YO2PfNKZVXTXhlJFq0bQ2x5e55oxGUQJ+8hNweRQZO2WmQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=m05n28PQ; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) 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 6E95E588D1 for ; Tue, 12 Dec 2023 21:14:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD98W-0007Q1-Ku; Tue, 12 Dec 2023 15:13:48 -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 1rD98V-0007Pj-Ko for bug-guix@gnu.org; Tue, 12 Dec 2023 15:13:47 -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 1rD98V-00033k-C8 for bug-guix@gnu.org; Tue, 12 Dec 2023 15:13:47 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rD98k-0007hi-G4 for bug-guix@gnu.org; Tue, 12 Dec 2023 15:14:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#67802: Shepherd is not able to run simple networked programs as services Resent-From: Lars Rustand Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 12 Dec 2023 20:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67802 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 67802@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170241203829565 (code B ref -1); Tue, 12 Dec 2023 20:14:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Dec 2023 20:13:58 +0000 Received: from localhost ([127.0.0.1]:57635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rD98f-0007gg-3u for submit@debbugs.gnu.org; Tue, 12 Dec 2023 15:13:58 -0500 Received: from lists.gnu.org ([2001:470:142::17]:45482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rD7er-0004xZ-TB for submit@debbugs.gnu.org; Tue, 12 Dec 2023 13:39:06 -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 1rD7eW-0001DB-8A for bug-guix@gnu.org; Tue, 12 Dec 2023 13:38:44 -0500 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rD7eT-0001jW-Cj for bug-guix@gnu.org; Tue, 12 Dec 2023 13:38:43 -0500 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-50bf898c43cso5717763e87.1 for ; Tue, 12 Dec 2023 10:38:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702406317; x=1703011117; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:user-agent:from:to:cc:subject:date:message-id:reply-to; bh=V62GJQbCqX6shMmdG1VcWZhXGMBBfjYdvtInwqV9YRI=; b=m05n28PQGBKZ1tqDXUo/AbvDhxtj50oLFkhMekM1LqMR41vxC5B9ICSlUh2w2Oo9tn CO9g/VCtMiQ4bXT6KkOAR9SfVpnt0YvUo00KvAnlPg8frND1o887N0h1tLvL30gY3jWy E1A8PO7ooX2IZPNbWWiVPNhy5nZggtFNQk0sBleQrbi9Q3BNNmE9M08HRY2Tq3MIwwjc 3kTIvpRHVRwvYzizQFPyd4J1oZG8yMpWD3p+FpOVpCI0O5n9M/kVXO971M/2wRKZaFyB Ypzxnojy/WFQLA0Oi9lNo/Tq8ugUGOnoTr5SagiGNkzh35e22Ff/d3tdQ/L/9QQ3s+4m 2t1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702406317; x=1703011117; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:user-agent:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=V62GJQbCqX6shMmdG1VcWZhXGMBBfjYdvtInwqV9YRI=; b=IkFgx7KK9+6xwbakdwbkL3I8u1vpPVRrFyn48rtrvsj5yA5Su/CCQnLSPcQwLUJdtq IyVG6O/c9Ifz/aos/ebDgSZV/keTtcGsgdr1dzYPVo6OKct5Yu505Ty0yL/p4jlHaSLS x5hZ0xcb4VT/ZlAhF6n4KMslNZ6wJfHF544UBoKxlE0gNU50Mn6uUwDchfwjydB37rES goKUUJrXy0wQGypiIYqq/eV1Vrv1f7zAaJ3BAFax0erpHhUdRjE9ae1rIvakCm3cEMZG QIirLeTwWN/5dGL6TVeTGX0mJUffURiSGCk7XYO4YG5/EgOqIMT12gmHzQleNQfSxn9t vrSQ== X-Gm-Message-State: AOJu0Yx9wDwHg5BgkRrFq8x5CxqWHPJPJY0uD6J6ijJ5jF7pO5SXFYWB SMCcT6cBCdhdFcrbo7G6CaRYtP6Drnw= X-Google-Smtp-Source: AGHT+IE1ull7XGs5p2PrNfBw7TCfyGh7fBP05323EekWr+vn8xrYQF9XYZk2V63rAI9WGsEuO/90mA== X-Received: by 2002:a05:6512:1284:b0:50b:f078:773f with SMTP id u4-20020a056512128400b0050bf078773fmr2512507lfs.59.1702406316408; Tue, 12 Dec 2023 10:38:36 -0800 (PST) Received: from localhost (78.79-160-60.customer.lyse.net. [79.160.60.78]) by smtp.gmail.com with ESMTPSA id u10-20020a05651206ca00b0050c0beaba37sm1409861lff.154.2023.12.12.10.38.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 10:38:35 -0800 (PST) User-agent: mu4e 1.10.8; emacs 30.0.50 From: Lars Rustand Date: Tue, 12 Dec 2023 18:43:09 +0100 Message-ID: <877clje05x.fsf@yoga.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=rustand.lars@gmail.com; helo=mail-lf1-x12b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 12 Dec 2023 15:13:51 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: -5.08 X-Spam-Score: -5.08 X-Migadu-Queue-Id: 6E95E588D1 X-Migadu-Scanner: mx12.migadu.com X-TUID: sVWvLevb6VNA Hello, I have created two very simple shepherd services for two different mail programs (offlineimap and davmail). Both of the programs are able to run without problem when ran from the commandline, but both of them fail with networking related errors when I try to run them as shepherd services. I have read all the relevant sections of the manual and looked at similar shepherd services in the source code, but I can't find anything that I am missing in my services. I am either missing something obvious here or shepherd is doing something weird that messes up these programs. Here is my service definition for offlineimap: --8<---------------cut here---------------start------------->8--- (define-module (lrustand services offlineimap) #:use-module (gnu) #:use-module (gnu services) #:use-module (gnu packages mail) #:use-module (gnu services shepherd) #:use-module (gnu services configuration) #:use-module (guix gexp) #:use-module (guix records) #:use-module (ice-9 curried-definitions) #:use-module (gnu home services) ;; For the 'home-shepherd-service-type' mapping. #:use-module (gnu home services shepherd) #:export (offlineimap-configuration offlineimap-configuration? offlineimap-configuration-log-file offlineimap-configuration-pid-file offlineimap-shepherd-service offlineimap-service-type home-offlineimap-service-type)) (define-configuration/no-serialization offlineimap-configuration (pid-file (string "/var/run/offlineimap.pid") "Where to store the PID file.") (config-file (string "/home/lars/.config/offlineimap/config") "Configuration file to use.") (log-file (string "/home/lars/offlineimap.log") "File where =E2=80=98offlineimap=E2=80=99 writes its log to.") (user (string "lars") "") (extra-options (list-of-strings '()) "This option provides an =E2=80=9Cescape hatch=E2=80=9D for the user to = provide arbitrary command-line arguments to =E2=80=98offlineimap=E2=80=99 as a list= of strings.") (home-service? (boolean for-home?) "")) (define offlineimap-shepherd-service (match-record-lambda (pid-file config-file log-file user extra-options home-service?) (list (shepherd-service (provision '(offlineimap)) (documentation "") (requirement (if home-service? '() '(networking user-processes))) (start #~(make-forkexec-constructor (list (string-append #$offlineimap "/bin/offlineimap") #$@extra-options "-c" #$config-file "-l" #$log-file) #:user #$user #:environment-variables (list (string-append "HOME=3D" (passwd:dir (getpw #$us= er)))) #:log-file #$log-file #:pid-file #$pid-file)) (stop #~(make-kill-destructor)) (one-shot? #f) (respawn? #t))))) (define offlineimap-service-type (service-type (name 'offlineimap) (extensions (list (service-extension shepherd-root-service-type offlineimap-shepherd-service))) (default-value (offlineimap-configuration)) (description "Synchronize remote IMAP mail with local Maildir."))) (define home-offlineimap-service-type (service-type (inherit (system->home-service-type offlineimap-service-type)) (default-value (for-home (offlineimap-configuration))))) --8<---------------cut here---------------end--------------->8--- And here is my service definition for davmail: --8<---------------cut here---------------start------------->8--- (define-module (lrustand services davmail) #:use-module (gnu) #:use-module (gnu services) #:use-module (gnu packages mail) #:use-module (gnu services shepherd) #:use-module (gnu services configuration) #:use-module (guix gexp) #:use-module (guix records) #:use-module (ice-9 curried-definitions) #:use-module (gnu home services) ;; For the 'home-shepherd-service-type' mapping. #:use-module (gnu home services shepherd) #:export (davmail-configuration davmail-configuration? davmail-configuration-log-file davmail-configuration-pid-file davmail-shepherd-service davmail-service-type home-davmail-service-type)) (define-configuration/no-serialization davmail-configuration (pid-file (string "/var/run/davmail.pid") "Where to store the PID file.") (config-file (string "/home/lars/.config/davmail/davmail.properties") "Configuration file to use.") (log-file (string "/home/lars/davmail.log") "File where =E2=80=98davmail=E2=80=99 writes its log to.") (extra-options (list-of-strings '()) "This option provides an =E2=80=9Cescape hatch=E2=80=9D for the user to = provide arbitrary command-line arguments to =E2=80=98davmail=E2=80=99 as a list of = strings.") (home-service? (boolean for-home?) "")) (define davmail-shepherd-service (match-record-lambda (pid-file config-file log-file extra-options home-service?) (list (shepherd-service (provision '(davmail)) (documentation "") (requirement (if home-service? '() '(user-processes))) (start #~(make-forkexec-constructor (list (string-append #$davmail "/bin/davmail") #$@extra-options "-c" #$config-file) #:log-file #$log-file #:pid-file #$pid-file)) (stop #~(make-kill-destructor)) (one-shot? #f) (respawn? #t))))) (define davmail-service-type (service-type (name 'davmail) (extensions (list (service-extension shepherd-root-service-type davmail-shepherd-service))) (default-value (davmail-configuration)) (description "Gateway for Outlook mail to regular IMAP and SMTP"))) (define home-davmail-service-type (service-type (inherit (system->home-service-type davmail-service-type)) (default-value (for-home (davmail-configuration))))) --8<---------------cut here---------------end--------------->8--- Offlineimap fails with a socket error: --8<---------------cut here---------------start------------->8--- 2023-12-12 19:34:33 2023-12-12 19:34:33 Traceback: 2023-12-12 19:34:33 File "/gnu/store/g2231vkzbnncyj72085n1ylkh8hq16lm-off= lineimap-8.0.0/lib/python3.10/site-packages/offlineimap/accounts.py", line = 298, in syncrunner 2023-12-12 19:34:33 self.__sync() 2023-12-12 19:34:33 File "/gnu/store/g2231vkzbnncyj72085n1ylkh8hq16lm-off= lineimap-8.0.0/lib/python3.10/site-packages/offlineimap/accounts.py", line = 374, in __sync 2023-12-12 19:34:33 remoterepos.getfolders() 2023-12-12 19:34:33 File "/gnu/store/g2231vkzbnncyj72085n1ylkh8hq16lm-off= lineimap-8.0.0/lib/python3.10/site-packages/offlineimap/repository/IMAP.py"= , line 681, in getfolders 2023-12-12 19:34:33 imapobj =3D self.imapserver.acquireconnection() 2023-12-12 19:34:33 File "/gnu/store/g2231vkzbnncyj72085n1ylkh8hq16lm-off= lineimap-8.0.0/lib/python3.10/site-packages/offlineimap/imapserver.py", lin= e 683, in acquireconnection 2023-12-12 19:34:33 e.args[0][:35] =3D=3D 'IMAP4 protocol error: socket= error:': 2023-12-12 19:34:33 --8<---------------cut here---------------end--------------->8--- And the davmail service fails with: --8<---------------cut here---------------start------------->8--- 2023-12-12 19:01:01 openjdk version "21" 2023-09-19 2023-12-12 19:01:01 OpenJDK Runtime Environment (build 21+-adhoc.nixbld.sou= rce) 2023-12-12 19:01:01 OpenJDK 64-Bit Server VM (build 21+-adhoc.nixbld.source= , mixed mode, sharing) 2023-12-12 19:01:01,734 DEBUG [main] davmail.DavGateway - Start DavMail in= server mode 2023-12-12 19:01:01 2023-12-12 19:01:01,734 DEBUG [main] davmail.DavGateway= - Start DavMail in server mode 2023-12-12 19:01:01,759 INFO [main] davmail - DavMail Gateway 6.2.0-3464 = listening on SMTP port 1025 IMAP port 1143 CALDAV port 1080 LDAP port 1389 2023-12-12 19:01:01 2023-12-12 19:01:01,759 INFO [main] davmail - DavMail= Gateway 6.2.0-3464 listening on SMTP port 1025 IMAP port 1143 CALDAV port = 1080 LDAP port 1389 2023-12-12 19:01:01,828 DEBUG [CheckRelease] davmail.http.HttpClientAdapter= - GET https://davmail.sourceforge.net/version.txt 2023-12-12 19:01:01 2023-12-12 19:01:01,828 DEBUG [CheckRelease] davmail.ht= tp.HttpClientAdapter - GET https://davmail.sourceforge.net/version.txt 2023-12-12 19:01:01,849 DEBUG [CheckRelease] davmail.http.DavGatewaySSLSock= etFactory - createSocket davmail.sourceforge.net 443 2023-12-12 19:01:01 2023-12-12 19:01:01,849 DEBUG [CheckRelease] davmail.ht= tp.DavGatewaySSLSocketFactory - createSocket davmail.sourceforge.net 443 2023-12-12 19:01:02,404 DEBUG [CheckRelease] davmail.DavGateway - DavMail = released version: 6.2.0-3464 2023-12-12 19:01:02 2023-12-12 19:01:02,404 DEBUG [CheckRelease] davmail.Da= vGateway - DavMail released version: 6.2.0-3464 2023-12-12 19:01:06,532 DEBUG [Shutdown] davmail - Stopping DavMail gateway 2023-12-12 19:01:06 2023-12-12 19:01:06,532 DEBUG [Shutdown] davmail - Sto= pping DavMail gateway 2023-12-12 19:01:06,539 INFO [Shutdown] davmail - DavMail gateway stopped 2023-12-12 19:01:06 2023-12-12 19:01:06,539 INFO [Shutdown] davmail - Dav= Mail gateway stopped --8<---------------cut here---------------end--------------->8--- They both seem to fail when opening an *outgoing* socket, but davmail seems to be able to start *listening* on several ports just fine.