From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <guix-devel-bounces+larch=yhetil.org@gnu.org>
Received: from mp2.migadu.com ([2001:41d0:303:e16b::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms8.migadu.com with LMTPS
	id oPhNBQrwBWbl+wAAe85BDQ:P1
	(envelope-from <guix-devel-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 28 Mar 2024 23:32:42 +0100
Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp2.migadu.com with LMTPS
	id oPhNBQrwBWbl+wAAe85BDQ
	(envelope-from <guix-devel-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 28 Mar 2024 23:32:42 +0100
X-Envelope-To: larch@yhetil.org
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=TshAnxGF;
	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";
	dmarc=pass (policy=none) header.from=gnu.org
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1711665162;
	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=Ii7bTS6LGt3BrU1QEnOwfGoXj3Sf+wRLTGP5MtKP3os=;
	b=OioaO2mQBWvyMNx7E6E8iGjMyCTdSPqfu9roD7L8/z3TwlFCA6pcKSZQaqpbeLvcpoKw2o
	enlkjOPjqvahd1B2w0mREYCdv0uDoucWdggb6zdRu/jN8CXE+BY/uQHN/d4JL8T3BBRFhS
	dp4FfyMSzd9bwT2pF2YNWxRMdwDAw1iPcjhj7wXGUgeONhUdfuDMiPmNhrNhmhNYKcOZ/d
	kEjn4TQVGOhXvOAM9gZCIfSvUTx6gPcXzSCrigdtjTsEGOf1BFuWUjZ9MI0NQ0OBM0RtFH
	TzWNpILFRHc2vHISCLJRB7VSrrobpndQXkWm1VgZW46fNCjO4P1IBXhhyho11A==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=TshAnxGF;
	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";
	dmarc=pass (policy=none) header.from=gnu.org
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1711665162; a=rsa-sha256; cv=none;
	b=J4tYRtUuv7b+ZQaGFE+Sd/RNq/hIbY3XTzXYNIc5xO+jlXGiwJO3cfqgz6IfZiQq5c9miQ
	jmQdZZSbO3HuK7Yjrqz+MHo138LyslSu9bJlCTPm3hnSZfdAoRw3pRKCsDk+7mDRXM+cMY
	+KckkOhCox2PFz0razs+pKjtpu5ZS7+Hu/b1LS/HvHT2/gWHdybaocD+qBGv9w5zzfK2yX
	1JO3zXvUHrgB1ldQLDatpOJ6IzXnAa9WPymZsj3A2RYXsWMYJ3Kf9nlDh4BHJ7L2jFGHlo
	1tnI6Mobp7ESOQ0X+9rceS7R0Fo1lRLVKM3E7xDpY7xNJPOypNQs05sjecNcOw==
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 EAD1640443
	for <larch@yhetil.org>; Thu, 28 Mar 2024 23:32:41 +0100 (CET)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <guix-devel-bounces@gnu.org>)
	id 1rpyI9-0005jy-O1; Thu, 28 Mar 2024 18:32:13 -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 <ludo@gnu.org>) id 1rpyI7-0005jZ-6Q
 for guix-devel@gnu.org; Thu, 28 Mar 2024 18:32:11 -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 <ludo@gnu.org>)
 id 1rpyI6-0004XO-Fa; Thu, 28 Mar 2024 18:32:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=Ii7bTS6LGt3BrU1QEnOwfGoXj3Sf+wRLTGP5MtKP3os=; b=TshAnxGFjZparXkBMfk6
 0cocuoC+PHyW9ExvBcLpEtDOK7gWSCYlM/2qj9mZgQLoQYYd+TUxzj/f998XOnWOhqNbalmw42FzU
 L3LvVdu4RfxFSXdBPxba4ZTTvcLqWdD/QSAIHJb4wLT3f8NbHMDbjA1oHe2hCvOSFclxkXz4GZxSV
 y4+3B41Lj5NZyeG2yTijaXS3z6eNImjP3qwVR3COPGlksSQ0M4CZZd9rfhVLOap4beDdfisYTqAh4
 hAJkj22+XAJOvCtBt6Ip+DcZQecdCMUJfBd50jl5LY0fJxaKiZPMfcxYmC4vmgp0le6TbEnLPGUId
 wzrjbXxRZNJ4ug==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@gnu.org>
To: Felix Lechner <felix.lechner@lease-up.com>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: Shepherd timers
In-Reply-To: <877chq3p48.fsf@lease-up.com> (Felix Lechner's message of "Mon,
 25 Mar 2024 15:47:51 -0700")
References: <87jzlrpbsr.fsf@gnu.org> <877chq3p48.fsf@lease-up.com>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Nonidi 9 Germinal an 232 de la =?utf-8?Q?R=C3=A9volu?=
 =?utf-8?Q?tion=2C?= jour de l'Aulne
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Thu, 28 Mar 2024 23:32:07 +0100
Message-ID: <87o7ayj8d4.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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."
 <guix-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-devel>,
 <mailto:guix-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/guix-devel>
List-Post: <mailto:guix-devel@gnu.org>
List-Help: <mailto:guix-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-devel>,
 <mailto:guix-devel-request@gnu.org?subject=subscribe>
Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org
Sender: guix-devel-bounces+larch=yhetil.org@gnu.org
X-Migadu-Country: US
X-Migadu-Flow: FLOW_IN
X-Spam-Score: -11.10
X-Migadu-Queue-Id: EAD1640443
X-Migadu-Scanner: mx13.migadu.com
X-Migadu-Spam-Score: -11.10
X-TUID: aCJJcDd3Hkuf

Hello!

Felix Lechner <felix.lechner@lease-up.com> skribis:

> The simple example worked great, but my more complex attempt to convert
> an mcron job seems to have failed.  Do you know why?
>
> (define (rsync-debbugs-shepherd-service config)
>   (shepherd-service
>    (provision '(rsync-debbugs))

Nice use case.  :-)

>> herd restart rsync-debbugs
> Service user-homes has been started.
> Starting service rsync-debbugs...
> Service rsync-debbugs started.
> Service rsync-debbugs running with value #<<timer> channel: #<<channel> g=
etq: #<atomic-box 7fb467c1c990 value: (())> getq-gc-counter: #<atomic-box 7=
fb467c1c980 value: 42> putq: #<atomic-box 7fb467c1c960 value: (())> putq-gc=
-counter: #<atomic-box 7fb467c1c950 value: 42>> event: #<<calendar-event> s=
econds: (0) minutes: (iota 12 3 5) hours: (0 1 2 3 4 5 6 7 8 9 10 11 12 13 =
14 15 16 17 18 19 20 21 22 23) days-of-month: (1 2 3 4 5 6 7 8 9 10 11 12 1=
3 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31) months: (1 2 3 4 5=
 6 7 8 9 10 11 12) days-of-week: #f> action: #<<command> arguments: ("/gnu/=
store/1g0gk9pcymgc0bb1dh115swakmh438p6-rsync-3.2.7/bin/rsync" "-4" "--delet=
e" "-av" "--password-file=3D/root/secrets/var-lib-debbugs.rsync" "debbugs-v=
ar@debbugs.gnu.org::var-lib-debbugs" "/var/lib/debbugs/") user: #f group: #=
f environment-variables: ("HOME=3D/" "TERM=3Dlinux" "BOOT_IMAGE=3D/gnu/stor=
e/psn2jwyrvr8jxb1nrndxf3h7kg8vvfwa-linux-6.6.2/bzImage" "PATH=3D/gnu/store/=
2jbvnib5ar70q1vlhhngish1svqfry0j-e2fsck-static-1.46.4/sbin:/gnu/store/jlbzc=
gxxzhynv74ss2510b0x978srnf9-loadkeys-static-2.5.1/bin" "GUIX_LOCPATH=3D/gnu=
/store/5fmqijrs5f7vx8mc2q2pmq26yvhb74sm-glibc-utf8-locales-2.35/lib/locale"=
) directory: "/" resource-limits: ()>>.
> Service rsync-debbugs has been started.
> #[STATUS] End time 2024-03-25 14:04:40, duration 1.081s
> (root@wallace-server.local)[/s/srv/patchwise]
>> herd status rsync-debbugs
> #[STATUS] End time 2024-03-25 14:07:41, duration 159.524s

So =E2=80=98herd status rsync-debbugs=E2=80=99 exited after 160s without pr=
inting
anything?  What does /var/log/messages say?

I tried something similar on my laptop but it seems to work.

Namely, I have:

--8<---------------cut here---------------start------------->8---
(use-modules (shepherd service timer))

(define gc-timer
  (service
   '(gc)
   #:start (make-timer-constructor
            (calendar-event #:minutes '(0))
            (command '("/run/current-system/profile/bin/guix" "gc" "-F2G")
                     #:user "ludo"))
   #:stop (make-timer-destructor)
   #:actions (list timer-trigger-action)))

(register-services (list gc-timer))
--8<---------------cut here---------------end--------------->8---

And then I do:

  sudo herd load root that-file.scm

I start, restart, reload, restart, etc. and it seems fine.

Thanks for trying it out!

Ludo=E2=80=99.