From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YH4KK/ArjGNhVQEAbAwnHQ (envelope-from ) for ; Sun, 04 Dec 2022 06:11:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6Ib3KvArjGNP5gAAauVa8A (envelope-from ) for ; Sun, 04 Dec 2022 06:11:12 +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 721AE376A5 for ; Sun, 4 Dec 2022 06:11:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1hGt-0002op-AL; Sun, 04 Dec 2022 00:10:35 -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 1p1hGl-0002oE-QE for guix-devel@gnu.org; Sun, 04 Dec 2022 00:10:28 -0500 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1hGk-0003zl-5S; Sun, 04 Dec 2022 00:10:27 -0500 Received: by mail-qt1-x835.google.com with SMTP id x28so8323331qtv.13; Sat, 03 Dec 2022 21:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=u5gE0U2bE1jkaB4muyuhSPyCwZPEVvji0MV9jzw1pZI=; b=fZ6HoMKA+YJCdek2Z4kw4xRNhHEU4BTS+fywc34T74h4NrZkboib18R+DQ5YVWv98y REmxRSbSfbTOnVIaj2AgcM6d1jUoRkVPlt3NjithRFJmLwi3QWJXVUFPWVsxHKTxYd0L p4l8WSBJxsJ0W91/0K7GUZt0vJyMDYZBYWxHR4lLp2d+kybYIAk1JvWkOfP6D0UwPo6d /RA9aCHtxwntlAv1FlO6bcTDNZkuPvKza1nsuVSreUTOTA3h8P0XDHtJgj4R6GHgGg/v jh91svHgmJ8xe2ZGD5npXd17/XqIcEtYohthT+Z7SfBNrvmDsNeMRf+gmCDljFmwiRgZ 24Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=u5gE0U2bE1jkaB4muyuhSPyCwZPEVvji0MV9jzw1pZI=; b=vjKHojJFgLoAXVG2szsYtJ7I+JknHpFC55fxeOP8K83GK0qcPylihEIQ3qZY4NeUqj XTMdi4xUm466FTcnkpSEA3ikd72EGjawLGMoKxawmU1Hogl8BOlfHM3QzHnCpXQQQIFS H0nHgXD3IElXA8UGzObbey+Q39HLfL9Ua6TyJLO38B8QvFL0nGdq3fQ+uxcPsrIA3jDm M28+E+DNrRBIW44onyhdr2DqL9IE5ezhYClgGiOFJF3EdTwS8aweTum0+0qokk+zQ2g1 N5XsCDCfIWB4Y215xKUCmq7oh1r9UGLwaFNj28UNG2j1mzZWm12YAT3E0PZ7zh6rfVaa r66Q== X-Gm-Message-State: ANoB5plIRFqDnYnaQ+acE8lruJKskvxJLjxnL2RVaM3827yHRFcl9Paj jfBL8U8sq6JqW96/bF6O16RvpcGmoOc= X-Google-Smtp-Source: AA0mqf7F+tq/CcTbrWbDpPRmzSAta6nVEbagOx/4V8t1NoZGD0/hzJqHjA/3T4KYXvT5Ivop2EXIqg== X-Received: by 2002:ac8:7f83:0:b0:3a5:1fa1:f2 with SMTP id z3-20020ac87f83000000b003a51fa100f2mr57813665qtj.91.1670130623464; Sat, 03 Dec 2022 21:10:23 -0800 (PST) Received: from hurd (dsl-157-235.b2b2c.ca. [66.158.157.235]) by smtp.gmail.com with ESMTPSA id q13-20020a05620a0d8d00b006fab416015csm9558961qkl.25.2022.12.03.21.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Dec 2022 21:10:23 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Subject: Re: branch master updated: doc: Recommend avoiding execl, execle or execlp in mcron job specifications. References: <166969482303.24641.999754855039128907@vcs2.savannah.gnu.org> <87fsdyup5l.fsf@gnu.org> Date: Sun, 04 Dec 2022 00:10:21 -0500 In-Reply-To: <87fsdyup5l.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Fri, 02 Dec 2022 10:32:22 +0100") Message-ID: <87bkoj7o02.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x835.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list 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+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670130672; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=u5gE0U2bE1jkaB4muyuhSPyCwZPEVvji0MV9jzw1pZI=; b=KO1Qc19sNp5af878Yzl/PDpQ8L1Jre8Zf9NWgEsfeTvsocgNIeAd1TTizk+ZGn4q5Y4pwb pqakTeKsJRKPg99ikG4/OCJdqSRx0cRtz2/uCHgV24XmG7pVX31LUrwUlBmTvi5cxgag4L RaIizrKJ/LtYDhPnpdZUMd2P7HIC1nv2OA/Xw+4MVBR4xVrn1WJSB0LdGyEux6oBQyWQuU N30gyc4AulaQnfxpno/ErVnuq67feMv/E2wC1BtW0Kn5+JyiOh5knYF3dAuLTml2dgASU2 53ygCDZyShWUpuKWkhZ+0hpJNKhYel0qgpdclUQBm6SHk2WY+ASumjl8fsK5MA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670130672; a=rsa-sha256; cv=none; b=d/qMSYHXSt4D0BU2C5JHMYuucheVbF6EOVT79NBpKZoG8CYAx4UnlvwQTul4n/qLJ9A90x B3KB0OUUp7oPFA/hq6lUiCM5Qy4oj3HT1b8TCSyQlUPuFtPSwdReQeZIsX66qEyI1xlUvY mlQQmlT25xu3KJa1dgXMBdi6LXp8EtwoRU20B9U1TV6xGA77Vglsn3PjPZKsZZ5o4zJtb6 dCipZUIid5CoKaGaHiRF37hynC4ntRHk7ENFRum/RYdhvBaK41IItpBDjaDxYc3ZQAWpu8 zIpEJ4R4fNEI+QNHlkLNL9Gl2+s0rvjyRbrB1sxD8bdZkaw607suLVA+VW0i/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fZ6HoMKA; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.96 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fZ6HoMKA; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 721AE376A5 X-Spam-Score: -3.96 X-Migadu-Scanner: scn1.migadu.com X-TUID: Y49iSLsnOjwK Hi Ludovic, Ludovic Court=C3=A8s writes: > Hello, > > guix-commits@gnu.org skribis: > >> diff --git a/doc/guix.texi b/doc/guix.texi >> index e547d469f4..caa6976a82 100644 >> --- a/doc/guix.texi >> +++ b/doc/guix.texi >> @@ -18940,9 +18940,8 @@ gexps to introduce job definitions that are pass= ed to mcron >> ;; job's action as a Scheme procedure. >> #~(job '(next-hour '(3)) >> (lambda () >> - (execl (string-append #$findutils "/bin/updatedb") >> - "updatedb" >> - "--prunepaths=3D/tmp /var/tmp /gnu/store")) >> + (system* (string-append #$findutils "/bin/updatedb") >> + "--prunepaths=3D/tmp /var/tmp /gnu/store")) >> "updatedb")) >>=20=20 >> (define garbage-collector-job >> @@ -18980,6 +18979,12 @@ the job would appear as ``Lambda function'' in = the output of >> @command{herd schedule mcron}, which is not nearly descriptive enough! >> @end quotation >>=20=20 >> +@quotation Tip >> +Avoid calling the Guile procedures @code{execl}, @code{execle} or >> +@code{execlp} inside a job specification, else mcron won't be able to >> +output the completion status of the job. >> +@end quotation > > The problem is that this creates an additional process and the first one > now just sits there in =E2=80=98waitpid=E2=80=99. > > Could mcron return the completion status of the process that calls the > thunk? It suppose it=E2=80=99s already monitoring it (via SIGCHLD or a d= irect > =E2=80=98waitpid=E2=80=99 call) so it should have that info available, no? Yes, that should be possible, and I agree that's desirable. We'd have to move the finalization logging from 'run-job' to 'child-cleanup', both defined in (mcron base), moving or factoring out 'seconds-since' and also recording the start date of the job in the record returned by 'run-job'. My personal mcron TODO now reads: --8<---------------cut here---------------start------------->8--- * mcron ** TODO Add a 'test' command to run scheduled action *now* ** TODO Log job completion status upon SIGCHLD --8<---------------cut here---------------end--------------->8--- But feel free to beat me to it! --=20 Thanks, Maxim