unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Tangonov <tn@eml.cc>
To: Fredrik Salomonsson <plattfot@posteo.net>
Cc: GUIX Help <help-guix@gnu.org>
Subject: Re: Guix home user-level shepherd services
Date: Thu, 16 Jun 2022 11:36:01 -0700	[thread overview]
Message-ID: <874k0k1mcz.fsf@eml.cc> (raw)
In-Reply-To: <87a6ack2dn.fsf@d2.com>


[-- Attachment #1.1: Type: text/plain, Size: 4207 bytes --]

Thanks Fredrik!

I really struggle with subtle details that are a few paragraphs 
deep, and so, I am embarassed.

If anyone else is reading this for reference: I should not have 
set =#:user #:t= for =make-forkexec-constructor=. The =#:user= 
keyword expects a string. My user is implicitly when left with the 
default value.

If I may say so, this has been easier to learn than systemd 
services. After many years of mostly failing to use systemd 
properly, I have not yet mastered it.

My user-level services are running :)

Fredrik Salomonsson <plattfot@posteo.net> writes:

> Hi Tangonov,
>
> Tangonov <tn@eml.cc> writes:
>
>> Ok, it seems as though I had some bash configuration issues. My 
>> "$(inline commands)" made things unhappy for some reason.
>>
>> I resolved them, and shepherd started working...except that 
>> herd 
>> was totally bound up and not responsive. I had to kill it to 
>> reconfigure.
>>
>> I assumed this is because the services were holding stuff 
>> up...so 
>> I tried a forked config:
>>
>> #+BEGIN_SRC scheme
>> (service home-shepherd-service-type
>>                  (home-shepherd-configuration
>>                   (services (list
>>                              (shepherd-service
>>                               (provision '(syncthing))
>>                               (start 
>>                               #~(make-forkexec-constructor
>>                                         "syncthing" #:user 
>>                                         #:t))
>>                               (stop #~(make-kill-destructor))
>>                               (documentation
>>                                "Synchronize folders to other 
>>                                device"))
>>                              (shepherd-service
>>                               (provision '(pantalaimon))
>>                               (start 
>>                               #~(make-forkexec-constructor
>>                                         "pantalaimon" #:user 
>>                                         #:t))
>>                               (stop #~(make-kill-destructor))
>>                               (documentation
>>                                "Crypto back-end server for 
>>                                ement.el"))))))
>> #+END_SRC
>>
>> The forked service does not seem to work :/
>>
>> #+BEGIN_QUOTE
>> λ herd start pantalaimon
>> herd: exception caught while executing 'start' on service 
>> 'pantalaimon':
>> Throw to key `match-error' with args `("match" "no matching 
>> pattern" "pantalaimon")'.
>> #+END_QUOTE
>>
>
> The issue is most likely that make-forkexec-constructor's 
> COMMAND
> argument expects a list of strings [0]. Try and see if this 
> works:
>
> #+BEGIN_SRC scheme
> (service home-shepherd-service-type
>                  (home-shepherd-configuration
>                   (services (list
>                              (shepherd-service
>                               (provision '(syncthing))
>                               (start 
>                               #~(make-forkexec-constructor
>                                         (list "syncthing") 
>                                         #:user #:t))
>                               (stop #~(make-kill-destructor))
>                               (documentation
>                                "Synchronize folders to other 
>                                device"))
>                              (shepherd-service
>                               (provision '(pantalaimon))
>                               (start 
>                               #~(make-forkexec-constructor
>                                         (list "pantalaimon") 
>                                         #:user #:t))
>                               (stop #~(make-kill-destructor))
>                               (documentation
>                                "Crypto back-end server for 
>                                ement.el"))))))
> #+END_SRC
>
> [0] 
> https://www.gnu.org/software/shepherd/manual/html_node/Service-De_002d-and-Constructors.html#Service-De_002d-and-Constructors


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

  reply	other threads:[~2022-06-16 18:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 23:18 Guix home user-level shepherd services Tangonov
2022-06-15 23:28 ` Tangonov
2022-06-16  1:09   ` Tangonov
2022-06-16 16:19     ` Fredrik Salomonsson
2022-06-16 18:36       ` Tangonov [this message]
2022-06-16 21:45         ` Fredrik Salomonsson
2022-06-19 12:23         ` Efraim Flashner

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=874k0k1mcz.fsf@eml.cc \
    --to=tn@eml.cc \
    --cc=help-guix@gnu.org \
    --cc=plattfot@posteo.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.
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).