From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 0AQgGn9C12UlWgEAqHPOHw:P1 (envelope-from ) for ; Thu, 22 Feb 2024 13:47:59 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 0AQgGn9C12UlWgEAqHPOHw (envelope-from ) for ; Thu, 22 Feb 2024 13:47:59 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=beffara.org header.s=key1 header.b=Cjlq+B3F; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=beffara.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708605464; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=+enAmO8H4JhpPD4pcIDKyPG1mZGj1Sx0NbVnpVrsSmI=; b=EqCXhH4dE3Injzj3ZvbyXgqhh0y69blPQqSEtlEJLRkUgcyF/eWPpQxSo++ao8TXqeyyEF o1LZ5s84eRHLztR6pk4nRewnaGLuDvCCctFMrZ3ZMVgm7ZeYDvtwfq09dTBAEKdktgchNi 1IejayN474muN1x/tkmCxEHRbda6oA9CHnI8C+uJAhT+g2sD0feTGVp4qvUt8aUWwX2xkx wqfzW9mSC3vLZ+3poOCbZQSaSnb/SFXMAftykJ+9W4RyjeD7K/pTw1O/RINRcsWrQJhwN0 mgn4/NidIYDR+Kf9psmvpO+4frlP87dzgC7M8pHpqPhdGBvXX4udpPJYPlJFrQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=beffara.org header.s=key1 header.b=Cjlq+B3F; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=beffara.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708605464; a=rsa-sha256; cv=none; b=ieRDBdVFg0iq91pv/D5cGGOL3YLLgji6mVvEPI++E5Grxp9yV2D6p9j/N8nTvhLuwBLOXW 0ZdhthKECkTX8fNkaWdZkiW4GqV+yaB/+KDAlz+NPTVVfVE+ZTyDXArbge/s69EfpfMVwL LAzpiktrZdxBxrpNaI0vhNJx+oDyWf3dJbyBiQB67TSEB1oge4ADMTHvwJMbJg8ct3JS7r gMPUQtLwbE0P9nBRuP6Ti5EZc1+snS5guVZM/vcMJc1ZcA1woq4DaAvo3rWw3fyKwmHdSh SQ8EFz77F4GKf8BpF7y2KsK+y2WJ3r7jgF9cMsFD85ad5SbVAdP+Lials8ECAg== 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 DD27D631D6 for ; Thu, 22 Feb 2024 13:37:43 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rd8KJ-0003hC-8w; Thu, 22 Feb 2024 07:37:23 -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 1rd8KH-0003fM-72 for help-guix@gnu.org; Thu, 22 Feb 2024 07:37:21 -0500 Received: from out-185.mta0.migadu.com ([2001:41d0:1004:224b::b9]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rd8KE-00027E-GA for help-guix@gnu.org; Thu, 22 Feb 2024 07:37:20 -0500 Date: Thu, 22 Feb 2024 13:37:10 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beffara.org; s=key1; t=1708605433; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=+enAmO8H4JhpPD4pcIDKyPG1mZGj1Sx0NbVnpVrsSmI=; b=Cjlq+B3F5qpdnB4cpqzfb+YkvSofJUuOXtNqOA50A1qXGrjLPySKET8A+DuC7PrL5ibWYY UG4gVOrwTMGMzmxEkWnTbwqnPtC83sgr8hjqqiMeb88c9kCAbxbN8wfK0p7MsP07CwBbh6 qK4KeuJ8EVdDIVsdAMjmUJ/1R0/qhwMB7F0WXuOHsxLE6W7tr2emNQ9g7Z1tcOPmlMnLba 7JeRT2e0SAb3QyYEVy/iYioMLi17e3ivLSGJB3AwmK5qckXz3QaDLIlOuTGktYFax/kbWr bfRr2h+mCx44U0kCRdID1xK+KJm/uo9eCOT8NKo0AfS9TwT1Bul6Trk+XUELuA== Message-ID: <20240222133710.GD2086@beffara.org> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Emmanuel Beffara To: help-guix@gnu.org Subject: mcron service and PATH (was: Home service for mbsync?) In-Reply-To: <87v86g6e7s.fsf@zancanaro.id.au> References: <87bk89ee80.fsf@lease-up.com> <87v86g6e7s.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2001:41d0:1004:224b::b9; envelope-from=manu@beffara.org; helo=out-185.mta0.migadu.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, 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-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -7.47 X-Spam-Score: -7.47 X-Migadu-Queue-Id: DD27D631D6 X-TUID: l9vz1GsQalUM Hello, De Carlo Zancanaro le 22/02/2024 à 10:27: > On Wed, Feb 21 2024, Felix Lechner via wrote: > > Does anyone have an 'mbsync' home service, please? Thanks! > > I just run mbsync as an mcron service. I have a custom script, because I > do some weird stuff to update my mu index afterwards, but it shouldn't > be hard to figure out how to call mbsync directly. > > In my home services I have this: > > (simple-service 'mail-update-script > home-mcron-service-type > ;; Update email every five minutes. > (list #~(job '(next-minute '(0 5 10 15 20 25 30 35 40 45 50 55)) > "/home/carlo/.local/bin/fetch-mail"))) > > Obviously this doesn't handle configuring mbsync, which I do outside of > my home configuration. I'm doing something similar, with a custom script that calls mbsync and does some additional stuff for indexing and tagging by notmuch. I recently noticed an issue with that: it seems that the command in the mcron job is called with an incomplete PATH. I diagnosed that by creating a similar mcron job with the command "/usr/bin/env > ~/E". Apparently my user profile (as defined in .profile, which is managed by guix home) is indeed inherited by the job, except for PATH which is reset and just contains /run/current-system/profile/bin. This is problematic if the job wants to call a command that is not in the system profile. A workaround would be to define the job with an explicit reference to a package, like: (service home-mcron-service-type (home-mcron-configuration (jobs (list #~(job '(next-minute (range 0 60 5)) (string-append #$isync "/bin/mbsync inbox") ))))) but this does not completely solve the issue since PATH is still reset and any command that is called through mbsync (e.g. through a PassCmd setting) will fail if it does not have an absolute path. Is there a proper way to inherit PATH from the user profile in mcron jobs ? -- Emmanuel