From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Efraim Flashner <efraim@flashner.co.il>
Cc: guix-devel@gnu.org
Subject: Re: modular shepherd config
Date: Tue, 14 Apr 2020 00:46:21 -0400 [thread overview]
Message-ID: <87d08aisiq.fsf@gmail.com> (raw)
In-Reply-To: <20200409212055.GW1518@E5400> (Efraim Flashner's message of "Fri, 10 Apr 2020 00:20:55 +0300")
Hello Efraim,
Efraim Flashner <efraim@flashner.co.il> writes:
> A while ago I split my personal shepherd init.scm into a bunch of files
> and I wanted to document it somewhere for others to see also. Any
> suggestion where I should put it? Shepherd manual? guix-cookbook?
Since this is purely about organizing Shepherd services (with nothing
specific about Guix), I'd add this to the Shepherd manual; then perhaps
link to it from other places if relevant.
> (ins)efraim@E5400 ~$ tree .config/shepherd/
> .config/shepherd/
> ├── init.d
> │ ├── dropbox.scm
> │ ├── fccache.scm
> │ ├── gnupg.scm
> │ ├── guix.scm
> │ ├── kdeconnect.scm
> │ ├── mbsync.scm
> │ ├── syncthing.scm
> │ └── vdirsyncer.scm
> ├── init.scm
> └── shepherd.log
>
> (ins)efraim@E5400 ~$ cat .config/shepherd/init.scm
> (use-modules (shepherd service)
> ((ice-9 ftw) #:select (scandir)))
>
> ;; Load all the files in the directory 'init.d' with a suffix '.scm'.
> (for-each
> (lambda (file)
> (load (string-append "init.d/" file)))
> (scandir (string-append (dirname (current-filename)) "/init.d")
> (lambda (file)
> (string-suffix? ".scm" file))))
>
> ;; Send shepherd into the background
> (action 'shepherd 'daemonize)
Don't you also need to register the services and arrange to have them
started?
My init.scm looks like:
--8<---------------cut here---------------start------------->8---
;;; Shepherd User Services
(load "services.scm")
(register-services
emacs
gpg-agent
jackd
ibus-daemon
workrave)
;; Send shepherd into the background.
(action 'shepherd 'daemonize)
;; Services to start when shepherd starts:
(for-each start '(emacs
gpg-agent
ibus-daemon
workrave))
--8<---------------cut here---------------end--------------->8---
Thanks for sharing!
Maxim
next prev parent reply other threads:[~2020-04-14 4:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-09 21:20 modular shepherd config Efraim Flashner
2020-04-10 7:41 ` Pierre Neidhardt
2020-04-14 4:46 ` Maxim Cournoyer [this message]
2020-04-20 7:44 ` Jan Nieuwenhuizen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d08aisiq.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=efraim@flashner.co.il \
--cc=guix-devel@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.