From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id KLV2C0ZhKGQ3RQEASxT56A (envelope-from ) for ; Sat, 01 Apr 2023 18:52:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MG1mC0ZhKGQwwQAA9RJhRA (envelope-from ) for ; Sat, 01 Apr 2023 18:52:22 +0200 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 E593E38E46 for ; Sat, 1 Apr 2023 18:52:21 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pieSS-0003WY-LU; Sat, 01 Apr 2023 12:52:04 -0400 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 1pieSQ-0003W5-SZ for guix-patches@gnu.org; Sat, 01 Apr 2023 12:52:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pieSQ-0007yR-KY for guix-patches@gnu.org; Sat, 01 Apr 2023 12:52:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pieSQ-0008GT-GH for guix-patches@gnu.org; Sat, 01 Apr 2023 12:52:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62584] [PATCH] services: Add error/success service type. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Apr 2023 16:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62584 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Cc: 62584@debbugs.gnu.org Received: via spool by 62584-submit@debbugs.gnu.org id=B62584.168036789031729 (code B ref 62584); Sat, 01 Apr 2023 16:52:02 +0000 Received: (at 62584) by debbugs.gnu.org; 1 Apr 2023 16:51:30 +0000 Received: from localhost ([127.0.0.1]:38490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pieRu-0008Fh-Ci for submit@debbugs.gnu.org; Sat, 01 Apr 2023 12:51:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pieRs-0008FT-Ez for 62584@debbugs.gnu.org; Sat, 01 Apr 2023 12:51:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pieRl-0007vf-6K; Sat, 01 Apr 2023 12:51:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=/xJfL08F3P245O0lPGoc2uSw++TiGP76kclc0R/72DU=; b=P/HlPh098JlusayfPgDf IskxB9MtAXIcrFDioGG1QZHal8HuI8HHROY1hELAeFZPKEstmoPwi2j4+kuMmvI3mD9wiqZ40ytW1 +bTPxNqCic76w0z2+9oj3T+vmHgQlNpUV5M1YNg+ACL5Dqnef3QdWwtc6Ie1xAwqyFyF4RmEvenmJ EL+ZByokQEGr270iRVHHyeldo0w43Om09Zo2anICbQRUSe2/Nhidm9NovUD2spclvZ5fjYJMnamzw FV/rwSldQuKGtKqwCF+izoHsyEBkFv4Xk7KutAzkhbBtg8XWbN68rHolog24jMb4Pgy+9vFlylYo7 omPEBuVbG4xLVg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pieRk-0002H9-Br; Sat, 01 Apr 2023 12:51:20 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20230401072842.13315-1-ludo@gnu.org> <87y1nbevqp.fsf@envs.net> Date: Sat, 01 Apr 2023 18:51:17 +0200 In-Reply-To: <87y1nbevqp.fsf@envs.net> ("=?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?="'s message of "Sat, 01 Apr 2023 18:34:54 +0800") Message-ID: <87pm8nfsvu.fsf_-_@gnu.org> 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680367941; a=rsa-sha256; cv=none; b=nDeOgemC+QP1wNNu6U8H8zG9hF3JbANmuXh+M5HId/Hm0OrUzzQtkmsACBEXTqVh4bRziH DJRkcbU8MAAW0+u98NL7DA52z8KfbLlHbhDJILhMNmboWX6+30x9g+DQZ7qpYVXKG5VhJ1 tHc8VGrB8REukz+S8D3bmP7E93rpsVATKIRQZBGJSiejfGQSH5sNSfQen4e3iZLRcSvxzZ dqVmSZe667RvIP77OtJLHodELkRpZY1sA6/DvEePfn2GSF9x3bhNsaSwkahcszQ31e0ovj 9uUoxdr1Tum2b38Om80QeKsyU0fNV41stxqjq16SzabzfYC6yKoJlPAVcP5W+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="P/HlPh09"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680367941; 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: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=/xJfL08F3P245O0lPGoc2uSw++TiGP76kclc0R/72DU=; b=gvMfAYlRDgNkD8eQpXi9Tw3IuQ+qOhjR1vYGbPefPCAK6NCwxgqFJjYOs7hrGPUd5bTdyy vLsB61dvLzZ5NkCFvvieL257xguxhs6tmCTrcB3XnO+bkZyeZd3HbVqMcBMIdvoj65tKD+ 41o9cnENkHZlF4iDthTxgoDYh6TTkiqRnVox+Z0VUo8m8BX/3YZlLeRQrweWkre0skjtQ1 tvmClx1Ee9i6Bq6JRi604k5kGVXrlebm32kdvrjNkX92V7qFHe8IXM9GjjWU4PPVLgyLmc zDXiVYkr18NoykduooEZ/dWoT4wFRwXD6RkQ1d/70bqblM0DBLzf96RdNzrusg== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="P/HlPh09"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -5.23 X-Spam-Score: -5.23 X-Migadu-Queue-Id: E593E38E46 X-TUID: ZpWOJXyvIjPJ Hi =E5=AE=8B=E6=96=87=E6=AD=A6, =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > Ludovic Court=C3=A8s writes: > >> I think it=E2=80=99s good to have it by default, but that=E2=80=99s some= thing we can >> discuss. > > Okay, I don't think so... Well, naming and defaults are two hard issues in programming. >> +(define (error/success-boot-gexp _) >> + #~(begin >> + (display "error in finalization thread: Success\n" >> + (current-error-port)) >> + (sleep 2))) ;let the user notice--all this hasn't been = in vain > > How about make the message and delay customable? > > I prefer "No error in finalization thread: Success", > and 2 seconds may not be enough for a slow reader like me! Ah yes, good points! We could probably have a configuration record like we do for other services. That way, one could write, say: (service error/success-service-type (error/success-configuration (errno EINVAL) (message-type 'no-error) (delay 10))) I=E2=80=99d prefer to leave that for a subsequent patch though, so we can f= irst restore the previous situation. >> +(define error/success-service-type >> + (service-type >> + (name 'error/success) >> + (extensions >> + (list (service-extension boot-service-type >> + error/success-boot-gexp))) >> + (default-value 42) > > What are this 42 is for? It=E2=80=99s currently unused but increases the chances that it=E2=80=99ll = give the right answer. Thanks for your feedback! Ludo=E2=80=99.