From: Blake Shaw <blake@sweatshoppe.org>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: catonano@gmail.com, Andrew Tropin <andrew@trop.in>,
Josselin Poiret <dev@jpoiret.xyz>,
Guix Devel <guix-devel@gnu.org>,
GNU Guix maintainers <guix-maintainers@gnu.org>
Subject: Re: how to write services (was: Re: Teams)
Date: Wed, 15 Jun 2022 17:01:44 +0000 [thread overview]
Message-ID: <CAKjmbcA+PNVCZRnp3oY+P4iAeu4pTvtwUMuVRYk_mFoJpO=jUQ@mail.gmail.com> (raw)
In-Reply-To: <87bkuuyqf9.fsf@elephly.net>
[-- Attachment #1: Type: text/plain, Size: 4205 bytes --]
Ricardo:
Thats very good advice and will be a useful guide in refactoring the parts
of the system services documentation. I think in general, we need to find a
nice middle ground between the extremely general and the immediately
sensible, as I remember when I first got into guix 1.5 years ago, arriving
at services left me very confused. While as a recent PhD candidate in
philosophy of mathematics I'm a fellow appreciator of the power of
generality (the extreme genericity of scheme and guix is why I'm here!), I
also think if it doesn't obey strict linguistic rules it can antithetical
to its original purpose. For example, I remember being very confused about
"file-like objects", for the simple reason that it wasn't "a file or
file-like object". While this might come from a GNU terminological lineage
i'm unaware of, my immediate reaction to trying to understand file-likeness
is the simple rule that a semblance is strictly not what it resembles, and
likeness qualifies semblance. It would be improper to place phones in a
category of "phone-like objects", because the likeness assumes a
distinction from the thing itself. Perhaps it could be justified if we dive
into the minutiae of paraconsistent logic, but I think then we are going to
far (also, isn't 'everything a file' a motto of Unix, even if gnu is
strictly not?). But I've digressed; I think your straightforward
description above communicates many of the ideas better than the docs, but
I think this is a situation where we can have our cake and eat it too, so
to speak; usually, an appendage such as "file AND file-like objects" will
accomplish much of the work for us.
Catonano:
I think writing a home-service is much easier given that you don't need to
do produce an entire system generation before you find out what you did
wrong; it just depends on if you need your service initialized at startup
(system-services, globally defined and available prior to login) rather
than at login (home-services, per-user/locally defined).
I'm not on Mastodon but feel free to send your service my way for some
help, I'm still a beginner but a second pair of eyes is always nice to have.
ez,
b
---
Blake Shaw
Director, SWEATSHOPPE
sweatshoppe.org
---
On Wed, Jun 15, 2022 at 2:04 PM Ricardo Wurmus <rekado@elephly.net> wrote:
>
> catonano@gmail.com writes:
>
> > Il giorno mer, 15/06/2022 alle 01.52 +0700, Blake Shaw ha scritto:
> >>
> >> I found the documentation to be a bit confusing (understandably, as
> >> its new), but once the workflow snapped together its been amazing to
> >> see how easy it is to create new services.
> >
> > This is something I'm specifically interested in
> >
> > In fact, I wrote this toot that got several boosts and likes but NO
> > answer
> > https://floss.social/web/@abbienormal/108378060174601402
>
> I don’t know Odoo, but the general process is this:
>
> - look up the relevant documentation of your application to figure out
> what commands must be executed. Take note of any way to pass a
> configuration file.
>
> - copy an existing shepherd service. Maybe start with
> gnu/services/audio.scm, because it’s pretty simple while not completely
> trivial.
>
> - adjust the commands and names.
>
> In gnu/services/audio.scm you see the definition of mpd-service-type,
> which is a *system* service that 1) adds a user account, 2) does some
> one-shot preparation work, and 3) registers the mpd-shepherd-service.
>
> mpd-shepherd-service is a procedure returning a shepherd service. The
> service has a start and stop command. Adjust this for your service.
>
> mpd-shepherd-service refers to its argument “config”, which is supposed
> to be a Scheme configuration value. It’s just a record defined higher
> up as <mpd-configuration>. mpd-config->file turns that Scheme value
> into a string that can live in a file as the mpd configuration file.
>
> This is pretty much all there is to it. Some services are simpler and
> don’t need any one-shot setup, nor do they need system user accounts, so
> they would just boil down to a shepherd service definition.
>
> --
> Ricardo
>
[-- Attachment #2: Type: text/html, Size: 5153 bytes --]
next prev parent reply other threads:[~2022-06-15 17:03 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-04 12:07 Teams Ricardo Wurmus
2022-06-04 13:00 ` Teams Maxime Devos
2022-06-04 13:19 ` Teams Ekaitz Zarraga
2022-06-04 14:50 ` Teams Tobias Geerinckx-Rice
2022-06-04 15:52 ` Teams Maxime Devos
2022-06-04 15:56 ` Teams david larsson
2022-06-05 9:10 ` Teams pelzflorian (Florian Pelz)
2022-06-07 4:11 ` Teams Thiago Jung Bauermann
2022-06-05 8:19 ` Teams Josselin Poiret
2022-06-06 21:21 ` Teams Ludovic Courtès
2022-06-14 11:31 ` Teams Andrew Tropin
2022-06-14 18:52 ` Teams Blake Shaw
2022-06-15 6:19 ` how to write services (was: Re: Teams) catonano
2022-06-15 13:53 ` Ricardo Wurmus
2022-06-15 17:01 ` Blake Shaw [this message]
2022-06-15 17:32 ` Maxime Devos
[not found] ` <CAKjmbcA56WL8ude232fz_5_G9U2RfoNNf4gqMHu5tft5kMbjFQ@mail.gmail.com>
2022-06-15 22:04 ` Maxime Devos
2022-06-15 22:13 ` Maxime Devos
2022-06-15 22:28 ` Maxime Devos
2022-06-15 23:20 ` Blake Shaw
2022-06-16 8:27 ` Maxime Devos
2022-06-16 5:14 ` catonano
2022-06-16 6:46 ` Ricardo Wurmus
2022-06-16 13:09 ` Brian Cully via Development of GNU Guix and the GNU System distribution.
2022-06-18 11:53 ` how to write services indieterminacy
2022-06-18 12:23 ` Maxime Devos
2022-06-18 13:33 ` indieterminacy
2022-06-15 10:53 ` How to write a service (was: Re: Teams) catonano
2022-06-05 9:31 ` Teams Lars-Dominik Braun
2022-06-05 9:51 ` Teams zimoun
2022-06-05 10:00 ` Teams Julien Lepiller
2022-06-07 17:49 ` Teams Efraim Flashner
2022-06-05 9:51 ` Teams Andreas Enge
2022-06-09 4:39 ` Teams Eric Bavier
2022-06-05 10:30 ` Teams indieterminacy
2022-06-05 17:59 ` Teams Mathieu Othacehe
2022-06-06 21:26 ` Teams Ludovic Courtès
2022-06-06 14:12 ` Teams Maxim Cournoyer
2022-06-07 0:28 ` Teams Ryan Prior
2022-06-07 19:06 ` Teams Vagrant Cascadian
2022-06-08 21:30 ` Teams Ludovic Courtès
2022-06-09 2:21 ` Teams Thiago Jung Bauermann
2022-06-09 19:28 ` Teams Arun Isaac
2022-06-13 13:38 ` Teams Blake Shaw
2022-06-13 22:33 ` Teams raingloom
2022-06-21 15:21 ` Teams: first draft list zimoun
2022-06-21 17:28 ` bokr
2022-06-21 22:21 ` zimoun
2022-06-22 6:56 ` Efraim Flashner
2022-06-22 16:19 ` bokr
2022-06-22 7:59 ` Ricardo Wurmus
2022-06-22 9:19 ` zimoun
2022-06-22 12:30 ` Josselin Poiret
2022-06-22 13:10 ` Maxime Devos
2022-06-22 13:49 ` Ludovic Courtès
2022-06-22 14:18 ` Blake Shaw
2022-07-01 10:28 ` Ricardo Wurmus
2022-07-01 17:36 ` Liliana Marie Prikler
2022-07-01 19:08 ` Ricardo Wurmus
2022-07-03 13:04 ` Teams: please add yourself to etc/teams.scm.in Ricardo Wurmus
2022-07-03 14:51 ` Andreas Enge
2022-07-01 20:53 ` Teams: first draft list Leo Famulari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKjmbcA+PNVCZRnp3oY+P4iAeu4pTvtwUMuVRYk_mFoJpO=jUQ@mail.gmail.com' \
--to=blake@sweatshoppe.org \
--cc=andrew@trop.in \
--cc=catonano@gmail.com \
--cc=dev@jpoiret.xyz \
--cc=guix-devel@gnu.org \
--cc=guix-maintainers@gnu.org \
--cc=rekado@elephly.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).