From: Jan Nieuwenhuizen <janneke@gnu.org>
To: 43921@debbugs.gnu.org
Cc: Efraim Flashner <efraim@flashner.co.il>
Subject: [bug#43921] [Shepherd PATCH 0/2] Add User Service example.
Date: Sun, 11 Oct 2020 11:40:40 +0200 [thread overview]
Message-ID: <874kn1rtgn.fsf@gnu.org> (raw)
Hi!
Ever since Efraim's excellent blog post
(https://guix.gnu.org/en/blog/2020/gnu-shepherd-user-services/) I have been
willing to try Shepherd's User Services (actually I wanted to try it for much
longer but it felt too daunting to dive in), and thanks to a nice discussion
on IRC this morning I finally gave it a go.
We were wondering it if would be feasible to add
--8<---------------cut here---------------start------------->8---
if [[ ! -S /run/user/$UID/shepherd/socket ]]; then
shepherd
fi
--8<---------------cut here---------------end--------------->8---
to /etc/skel/.bash_profile, and maybe even add
/etc/skel/.config/shepherd/init.scm:
--8<---------------cut here---------------start------------->8---
(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)
--8<---------------cut here---------------end--------------->8---
that I got from Efraim's blog post. For starters, I have put this
in the Shepherd manual. WDYT?
Greetings,
Janneke
Jan (janneke) Nieuwenhuizen (2):
Use XDG_CACHE_HOME/shepherd for unprivileged users' log directory.
Add User Service example.
doc/shepherd.texi | 75 +++++++++++++++++++++++++++++++++---
modules/shepherd/support.scm | 15 +++++++-
2 files changed, 83 insertions(+), 7 deletions(-)
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
next reply other threads:[~2020-10-11 9:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-11 9:40 Jan Nieuwenhuizen [this message]
2020-10-11 9:43 ` [bug#43921] [Shepherd PATCH 1/2] Use XDG_CACHE_HOME/shepherd for unprivileged users' log directory Jan (janneke) Nieuwenhuizen
2020-10-11 9:43 ` [bug#43921] [Shepherd PATCH 2/2] Add User Service example Jan (janneke) Nieuwenhuizen
2020-10-11 10:38 ` Jan Nieuwenhuizen
2020-10-11 12:10 ` [bug#43921] [Shepherd PATCH v2 " Jan (janneke) Nieuwenhuizen
2020-10-12 5:15 ` [bug#43921] [PATCH v3 " Jan (janneke) Nieuwenhuizen
2020-10-23 13:31 ` Ludovic Courtès
2020-10-23 16:37 ` Jan Nieuwenhuizen
2020-11-18 21:37 ` bug#43921: " Ludovic Courtès
2020-11-19 6:00 ` [bug#43921] " 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
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=874kn1rtgn.fsf@gnu.org \
--to=janneke@gnu.org \
--cc=43921@debbugs.gnu.org \
--cc=efraim@flashner.co.il \
/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).