From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: Re: modular shepherd config Date: Tue, 14 Apr 2020 00:46:21 -0400 Message-ID: <87d08aisiq.fsf@gmail.com> References: <20200409212055.GW1518@E5400> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58564) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jODSq-0004ED-Po for guix-devel@gnu.org; Tue, 14 Apr 2020 00:46:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jODSp-0006I3-Kr for guix-devel@gnu.org; Tue, 14 Apr 2020 00:46:24 -0400 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]:32938) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jODSp-0006Ho-FS for guix-devel@gnu.org; Tue, 14 Apr 2020 00:46:23 -0400 Received: by mail-qt1-x832.google.com with SMTP id x2so9177841qtr.0 for ; Mon, 13 Apr 2020 21:46:23 -0700 (PDT) In-Reply-To: <20200409212055.GW1518@E5400> (Efraim Flashner's message of "Fri, 10 Apr 2020 00:20:55 +0300") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: Efraim Flashner Cc: guix-devel@gnu.org Hello Efraim, Efraim Flashner 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/ > =E2=94=9C=E2=94=80=E2=94=80 init.d > =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 dropbox.scm > =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 fccache.scm > =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 gnupg.scm > =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 guix.scm > =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 kdeconnect.scm > =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 mbsync.scm > =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 syncthing.scm > =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 vdirsyncer.scm > =E2=94=9C=E2=94=80=E2=94=80 init.scm > =E2=94=94=E2=94=80=E2=94=80 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