Subject: bug#43921: closed (Re: [bug#43921] [PATCH v3 2/2] Add User Service example.)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 18 Nov 2020 21:38:01 +0000

Your bug report

#43921: [Shepherd PATCH 0/2]  Add User Service example.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
43921: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=43921
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#43921] [PATCH v3 2/2] Add User Service example.
From: Ludovic Courtès <[email-masked]>
To: Jan Nieuwenhuizen <[email-masked]>
Cc: [email-masked], Efraim Flashner <[email-masked]>
Date: Wed, 18 Nov 2020 22:37:11 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Jan Nieuwenhuizen <[email-masked]> skribis:

>>>From ae64ec3bfa7a0e4e877f06161f2d6aacb5804960 Mon Sep 17 00:00:00 2001
> From: "Jan (janneke) Nieuwenhuizen" <[email-masked]>
> Date: Sun, 11 Oct 2020 10:59:04 +0200
> Subject: [PATCH v3 2/2] doc: Add "Managing User Services".
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> Content-Transfer-Encoding: 8bit
> Content-Type: text/plain; charset=UTF-8
>
> * modules/shepherd/support.scm: Export %user-cache-dir, %user-config-dir,
> %user-runtime-dir.
> * doc/shepherd.texi (Managing User Services): Use them in new section with
> example.
>
> Co-authored-by: Efraim Flashner <[email-masked]>
> Co-authored-by: Ludovic Courtès <[email-masked]>

Finally pushed; I changed ‘%user-cache-dir’ references to
‘%user-log-dir’:

  https://git.savannah.gnu.org/cgit/shepherd.git/commit/?id=4c5176f5a7a5a1e7d7f258f585e8ed127a21b99a

Thanks!

Ludo’.

Subject: [Shepherd PATCH 0/2] Add User Service example.
From: Jan Nieuwenhuizen <[email-masked]>
To: [email-masked]
Cc: Efraim Flashner <[email-masked]>
Date: Sun, 11 Oct 2020 11:40:40 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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 <[email-masked]> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com