From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id aP8qE2lKTme15QAA62LTzQ:P1 (envelope-from ) for ; Tue, 03 Dec 2024 00:01:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id aP8qE2lKTme15QAA62LTzQ (envelope-from ) for ; Tue, 03 Dec 2024 01:01:45 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="IDdYY/uK"; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733184105; a=rsa-sha256; cv=none; b=Mdn70PvoTURUCWDGXEbyvb8Rm8EvwhUZ4LOKs0R6DDerGKBylRL2qnocEw7TmsncmqR7en rT/esB2qw0GxUr9dmZKGWVwx45b6UQZy82evvlwzTKchuXbpPqTDnsHcQ3/m0JHF1/WkpE CE3VSuRCaWV9Zhq9ofm/TyaXjhCCy+oyDL25GPzti6nfG2BoAmd/NiOuaMwb+5iwzK4PIH wqC4NcvGgR8cNHAL+B0Caqz/Gr8TXGDDnO5UjpDaaJbQIFmkwxS3fQJ7goiwoIxawCtv2c +a11AAlTWqaZnjY1osyH2RByv4w0rcAN++eqynBcTfwwXsKfaLfwZ3erBQX31g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="IDdYY/uK"; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733184105; 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=qcAArQgyr/2K7DnrUdSvR524xConxOwN61c1W53R/nY=; b=LmIJtTkL+0cyVjzzARsxVEfza5ybiQeQKp1iFJT4qi2ClIwp05euFj2l6VRyjIkHozUN16 BU+6kcHpGR8/qWg94nBAie9HtOFvsrH7G+bfI4AlmRiGHtkFcrhEpwApZau2+FUsv7Thwm XDhaCgV8uRnpyjVHcyrcpzV0w/FJPAauyshpqM2anfJpKYtAVrnhRfmkeH9ujt/hZlSF5y qpOwL/2jdhBLsdLBlXlMJke53+jjXAfyP4BGSOcZyBGnLNptzlk2Md1Za9FQq569gPOoEz Yqml9xkJzvMf8TQ9ORhh91sHvfyWGvP8wY6uAQ7DlW+5xH8TzWKKC0+fvbTGnA== 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 1FDEB83AEC for ; Tue, 03 Dec 2024 01:01:45 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIGLp-0001jC-R5; Mon, 02 Dec 2024 19:01:13 -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 1tI57P-0006xs-KL for help-guix@gnu.org; Mon, 02 Dec 2024 07:01:36 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tI57N-0004ET-IK for help-guix@gnu.org; Mon, 02 Dec 2024 07:01:35 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7CD01240101 for ; Mon, 2 Dec 2024 13:01:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1733140888; bh=eBwyavEGh9TxRRYbM3dr7oVqnZDVzlvPbyWcWkS8Wtc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=IDdYY/uKZJteqhdNVZ/yh4N/iCkMTRi6OMyS9+DUZ89xorzjUZboRdNMAaWQFyukk As0HWh3KM3SN5SgMZXtvwfKu7CrJ7t6QOWzsx8AaC4YbgMiLZwuLXIGVtLlxAtFcuC XI2rHKKmt7KM2PSxw+nASlVqFbhtgap2GSh/7lneu38zx1OSZvytE+jebPtcoY2l2m HGcQWUzl4PVPTwKEqBmHR0nOiD4eE8mInIAuiIwVNJ7JeKYDPuNNlcGTCiwvGBO73Z oaIxb00brsRM/vBCDOTSa+NXiBUbnXHHMl6F9Ha5fNqkdrNzoaSpild83oQ7F3HlYj X5m7/MS/K8rQw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Y22SR63WCz6tvk; Mon, 2 Dec 2024 13:01:27 +0100 (CET) From: Yulran To: post@bonni.codes Cc: help-guix@gnu.org Subject: Re: trouble defining a shepherd service In-Reply-To: <8f98f94a896a188a078c09f0ef5c7c15@libre.brussels> (indieterminacy@libre.brussels's message of "Mon, 21 Oct 2024 09:52:15 +0200") References: <8f98f94a896a188a078c09f0ef5c7c15@libre.brussels> Date: Mon, 02 Dec 2024 12:01:25 +0000 Message-ID: <87jzci9tuy.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yulran@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 02 Dec 2024 19:01:11 -0500 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-Spam-Score: -5.42 X-Spam-Score: -5.42 X-Migadu-Queue-Id: 1FDEB83AEC X-Migadu-Scanner: mx10.migadu.com X-TUID: eu/eSgWAz936 Hi, I hope you found the solution in the meantime, but in case it helps, there'= s also an issue in your service-extension that will indeed cause 'Wrong typ= e to apply' or 'Wrong type argument' errors when you try to build your syst= em. The second argument of service-extension should be a function that takes on= e argument (the configuration passed to openslides-service-type) and return= s a valid configuration for shepherd-root-service-type, which I assume is a= list of shepherd services (I only tried with home-shepherd-service-type). Since you don't need a configuration, you can use 'const' to transform the = constant list of services into a function. So something like this should wo= rk: --8<---------------cut here---------------start------------->8--- (define-public openslides-service-type (service-type (name 'openslides) (description "The openslides-service-type") (extensions (list (service-extension shepherd-root-service-type (const (list openslides-shepherd-service))))) (default-value '()))) --8<---------------cut here---------------end--------------->8--- On Mon, Oct 21 2024, indieterminacy wrote: > Hey, > > A passing guess is that this line is incorrect: > >> #:directory =E2=80=9E/var/openslides" > > Try redefining it to this incase: > > #:directory "/var/openslides" > > HTH > > On 2024-10-20 23:56, post@bonni.codes wrote: >> Hello, >> I am trying to define a shepherd service to add to my system >> configuration. Reading the docs this is what I came up with: >> (define openslides-shepherd-service >> (shepherd-service >> (documentation "Runs the openslides docker-compose.") >> (provision '(openslides)) >> (requirement '(dockerd)) >> (start #~(make-forkexec-constructor >> (list >> #$(file-append docker-compose "/bin/docker-compose") >> "up") >> #:directory =E2=80=9E/var/openslides" >> #:log-file "/var/log/openslides.log" >> #:pid-file "/var/run/openslides.pid" >> #:user "openslides") >> ) >> (stop #~(make-kill-destructor)))) >> (define openslides-service-type >> (service-type >> (name 'openslides) >> (description "The openslides-service-type") >> (extensions >> (list (service-extension shepherd-root-service-type >> openslides-shepherd-service))) >> (default-value '()) >> )) >> The service only needs to run the docker-compose program in the >> directory /var/openslides . There is no need for configuration. >> If I build my operating system I get the following error: >> ice-9/boot-9.scm:1685:16: In procedure raise-exception: >> Wrong type to apply: #< documentation: "Runs the >> openslides docker-compose." provision: (openslides) requirement: >> (dockerd) one-shot?: #f respawn?: #t respawn-limit: #f >> respawn-delay: #f free-form: #f start: #> (make-forkexec-constructor (list #> #> 7ff9068e96e0> "/bin/docker-compose">:out> "up") #:directory >> "/var/openslides" #:log-file "/var/log/openslides.log" #:pid-file >> "/var/run/openslides.pid" #:user "openslides") >> /home/chris/helios-system/config.scm:38:10 7ff8fe625c00> stop: >> #> /home/chris/helios-system/config.scm:47:9 7ff8fe625bd0> actions: () >> auto-start?: #t modules: ((shepherd service) ((guix build utils) >> #:hide (delete)) (guix build syscalls))> >> indicating that there ist something wrong with the value for the >> start and stop fields. >> Where am I going wrong? >> Kind regards >> bonni >> -----BEGIN PGP PUBLIC KEY BLOCK----- >> mDMEZCntaxYJKwYBBAHaRw8BAQdANbpRRBxZVlIewesVvBOh2tlJCuK22g9lL5ZP >> 9xqJDtS0GGJvbm5pIDxwb3N0QGJvbm5pLmNvZGVzPoiWBBMWCAA+FiEE+lyu2HL6 >> Nk0naPZMGyPeqOa1B/sFAmQp7WsCGwMFCQWjmoAFCwkIBwIGFQoJCAsCBBYCAwEC >> HgECF4AACgkQGyPeqOa1B/snGAEAzddi9IcK/2EkrqPy2xmmwzLTAexKqZQqa+EE >> LdtcnNwBANV2xOXW6hASEz0SMz4FEbroFs2kv7by6Wcyy+Fxl0sHuDgEZCntaxIK >> KwYBBAGXVQEFAQEHQMrBS1fZCE1tuYac2MjA9nZit9leM8zlnyiaY6CdO/cRAwEI >> B4h+BBgWCAAmFiEE+lyu2HL6Nk0naPZMGyPeqOa1B/sFAmQp7WsCGwwFCQWjmoAA >> CgkQGyPeqOa1B/v95wD+N/6tRrCX9nqumpXgD3aZ8gcyA1uFSYP02HLyIUIwMY4A >> /2YC4i2z+G3nzMGBrfID2yXVJg4S4Bby/xOkDxKgYrYD >> =3DEEtE >> -----END PGP PUBLIC KEY BLOCK-----