From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tanguy Le Carrour Subject: Re: Guix shepherd user services Date: Sat, 4 May 2019 09:07:18 +0200 Message-ID: <20190504070718.xdt6i5475xydvh7i@melmoth> References: <20190429195749.t2kksa5lujoafnlf@melmoth> <87sgu0mv2b.fsf@nckx> <20190501090058.q34wlnxhbn6k3hwg@melmoth> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([209.51.188.92]:56546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMolW-0003bH-91 for guix-devel@gnu.org; Sat, 04 May 2019 03:07:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMolV-0002Qf-Aa for guix-devel@gnu.org; Sat, 04 May 2019 03:07:22 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:33997) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMolV-0002Pv-43 for guix-devel@gnu.org; Sat, 04 May 2019 03:07:21 -0400 Content-Disposition: inline In-Reply-To: <20190501090058.q34wlnxhbn6k3hwg@melmoth> 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.org@gnu.org Sender: "Guix-devel" To: Tobias Geerinckx-Rice Cc: guix-devel@gnu.org Hello! Le 05/01, Tanguy Le Carrour a écrit : > Le 04/29, Tobias Geerinckx-Rice a écrit : > > ~ λ cat /home/nckx/.config/shepherd/init.scm (load "services.scm") > > (register-services emacs gpg-agent ibus-daemon jackd) > > (action 'shepherd 'daemonize) ; send shepherd into background > > (for-each start (list emacs)) ; services to start automatically > > > > ~ λ cat /home/nckx/.config/shepherd/services.scm (define emacs > > (make > > #:provides '(emacs) > > #:requires '() > > #:start (make-system-constructor "emacs --daemon") > > #:stop (make-system-destructor "emacsclient --eval > > \"(kill-emacs)\""))) > > ;; ...much more snipped... > > > > ~ λ grep shepherd /home/nckx/.xsession shepherd # user service manager > > Cooooool! :-) > Did you write the "much more snipped" by yourself? If yes, is it > available somewhere? Else, is it documented somewhere? Did you > copy/paste it from another Guix file? I've been playing with shepherd and service configurations and it's actually easier than I thought it would be, at least for "simple" services. Thanks for showing me the way! :-) I love it so much that I started/stopped the emacs service (defined with the snippet above) a few times. It works as expected, except for the `defunct` processes that hang around. Each time I run `herd stop emacs`, I get a new one, as if shepherd could not forget about the dead process. This doesn't prevent me from re-starting the process and using the service, but it looks… messy! Am I doing something wrong?! -- Tanguy