help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto-start service


From: Ekaitz Zarraga
Subject: Re: Auto-start service
Date: Fri, 09 Jul 2021 12:21:16 +0000

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Friday, July 9th, 2021 at 12:28 AM, excalamus--- via <help-guix@gnu.org> 
wrote:

> I'm setting up the Emacs daemon following a thread on the mailing list:       
>  https://lists.gnu.org/archive/html/help-guix/2019-11/msg00148.html. I have 
> services.scm and init.scm defined.  I can call `shepherd -c 
> ~/.config/shepherd/init.scm` and the service starts.  I can kill the terminal 
> and connect a client with `emacsclient -c`.  Trouble is, I can't figure out 
> how to start the service on boot.
>
> The config files I'm using are:
>
> ;; services.scm
>
> (define emacsd
>
>   (make <service>
>
> #:provides '(emacsd)
>
>     #:start (make-system-constructor "emacs --daemon")
>
>     #:stop (make-system-destructor "emacsclient --eval \"(kill-emacs)\"")))
>
> ;; init.scm
>
> ;;; Shepherd User Services
>
> (load "/home/ahab/.config/shepherd/services.scm")
>
> (register-services
>
>  emacsd)
>
> ;; Send shepherd into the background.
>
> (action 'shepherd 'daemonize)
>
> ;; Services to start when shepherd starts:
>
> (for-each start '(emacsd))
>
> Based on what (shepherd) Jump Start paragraph 3 says, I'm confused about why 
> Shepard doesn't find the config files.  Is it because Shepherd starts as 
> superuser on boot?
>
> Meanwhile, I was advised to define a service in my config.  I'm in the 
> process of reading the documentation (really, figuring out how to set Geiser 
> up to read the documentation) so that I can understand the relevant parts.  
> Is the config the generally recommended approach for Guix SD versus the 
> $HOME/.config/shepherd directory?
>
> Surely someone else has set up an Emacs daemon service?  The linked thread 
> mentioned this being a good idea for a cookbook recipe.  I'd be happy to 
> contribute to that as I'm confident I'm not alone in wanting an Emacs daemon 
> service defined.


There's a blog post in Guix's blog about this configuration:

https://guix.gnu.org/en/blog/2020/gnu-shepherd-user-services/

I remember to have followed that and I have it working. I had to activate the 
user-level Shepherd by hand in any file that is executed when the system is 
started. In my case I have it in my i3 config. You can put it in .xsession like 
the thread you shared suggests.

Hope this helps.

Ekaitz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]