From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uFZ+HWD78V5tMgAA0tVLHw (envelope-from ) for ; Tue, 23 Jun 2020 12:53:52 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id yGhbGWD78V6fFAAAB5/wlQ (envelope-from ) for ; Tue, 23 Jun 2020 12:53:52 +0000 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 3844594060B for ; Tue, 23 Jun 2020 12:53:52 +0000 (UTC) Received: from localhost ([::1]:51086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jniQx-0003de-4x for larch@yhetil.org; Tue, 23 Jun 2020 08:53:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jniQo-0003bg-PA for help-guix@gnu.org; Tue, 23 Jun 2020 08:53:42 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:36756) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jniQn-0006rT-3X for help-guix@gnu.org; Tue, 23 Jun 2020 08:53:42 -0400 Received: by mail-ej1-x629.google.com with SMTP id dr13so21495636ejc.3 for ; Tue, 23 Jun 2020 05:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=v+DAP0epdrdIrCz7GOB1Z716PwZFm6M0TDMnNWetdBw=; b=oqltEmkKQ9PGsVhycVaVQz5NaYJ0Kpup+3wDyISOrHhRK296EvFQ/LO5bdcBt5KBYC vFSA15cJ9GE9hXfdb6MunOVBZAmGQ9LABAiUlP9YiUxiYjvSqkjLp5yuYHjnKVTLDxPN ij6FRMnowHIReB2TfxRhmh+ADxCgv/gPwd8UdLKB77PWd6+dAz79KauzvcZgx1QRV2sc rUopuckCl8KTeLKtV6A/EoMlec7YaGjl/S6JbHH/nu2cD+28lhOcoHwpJ2fKNBkM+VF8 1WtYVBXE1LmmwMPwdWjm0o7vJpwnT8EbAvGzpk6RKuI8XcaKOFzy4hOvJOdtTZRhDB8S YpPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=v+DAP0epdrdIrCz7GOB1Z716PwZFm6M0TDMnNWetdBw=; b=Luwex7LdKJshIXheEkgOfDELD8XsmIuXouwAKsJxCsReT5gu7CVx/O5dtfga9CtjXo ITbVI8iB/j/8OyXjx166sYsYMDO6YjS7VO+N8+eGErAFL1wYY9BhFIW1HND9rzPNsh8I iCbyRdkgWbZDPNQgOombRrXhSw23+xW6FaA3qwjxn+2GGviZsNkoAJKzR36CJ6KIuDrQ t1thbO3zPQcMPT6x443W6NxKvakCnnDIQ2LZocbF9+DiYzWUtl75WYllfshzBWh956Xy TV4qxYdd71Ek3sAa5hE6+nVgmV5qtNPBpWo0n0w4wgNi4gp9HD/EE4H7lfyUz6xVONDo L2Yg== X-Gm-Message-State: AOAM5314h1lBYntvX6tXmNnpCkO5HD51Z1QR+/ix7HJDKSmvsIw19GwL BZH7m1zntAwL6AhsI28Stz1CEm1ZjFarnvMClbbNeA== X-Google-Smtp-Source: ABdhPJxfCTyTUM41O2folmwetgCMpoAPBav/ogaYuHbXPA5p+fgd04s8dcS61aX4QOAOZZ4zAvm1oZtQDm3LuqW4N80= X-Received: by 2002:a17:906:b1c3:: with SMTP id bv3mr20761338ejb.292.1592916818890; Tue, 23 Jun 2020 05:53:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: conjaroy Date: Tue, 23 Jun 2020 08:53:02 -0400 Message-ID: Subject: Re: Dependencies between service extensions To: help-guix@gnu.org Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=conjaroy@gmail.com; helo=mail-ej1-x629.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=oqltEmkK; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: C1+DNINkgc7y Does anyone have feedback on how to implement this type of dependency correctly in a Guix service? On Sun, Jun 7, 2020 at 11:43 AM conjaroy wrote: > Greetings help-guix, > > I've been a casual user of Nix for a couple of years and have decided to > test the waters with Guix. While I'm looking forward to spending time with > Lisp after many years away, my biggest impression is that Guix seems to > have well-documented interfaces in cases where Nix relies more on loose > conventions. > > After reviewing the manual and some of the service definitions, I'd like a > better understanding of how to implement a common pattern. Let's say that I > have some application Foo that uses an external system for persistence, > like a SQL database. Before starting up service Foo I need to ensure both > that the database service is running and that the database instance for Foo > has been initialized, because Foo doesn't know how to initialize the > database on its own. > > The first issue (how to ensure that the database service is up) seems to > be solved by adding a shepherd-root-service-type service extension that > declares a set of "requirements". And the second issue (performing > pre-startup initialization) seems to be handled by the > activation-service-type extension. So far so good. > > But I couldn't find documentation on whether service activation scripts > can safely rely on other services that happen to be declared as > requirements in the shepherd-root-service-type extension. And while I found > many activation scripts that do simple things like modifying the > filesystem, I couldn't see any that interact directly with other services. > However, I did see some evidence of service extensions relying on the side > effects of other service extensions: a number of activation scripts call > "getpwnam" for info on system accounts that could exist only if the > corresponding account-service-type extension has already been executed. > > So my questions are: could someone clarify best practices for initializing > state in Service A before Service B starts up? And is there anything about > the ordering/dependencies of a service's extensions that could be better > documented in the manual? > > Thanks for all of your work on this project. > > Jason >