:: Re: [DNG] (runit) Can emacs daemon …
Página Inicial
Delete this message
Reply to this message
Autor: Lorenz
Data:  
Para: Alexandros Prekates
CC: Devuan emailing list (DNG)
Assunto: Re: [DNG] (runit) Can emacs daemon become a user service ?
Hi,

> So although i havent a complete runit service (no log) its working.
> The main issue is that in a system wide service i have inserted
> export HOME=/home/chomwitt and named the socket chomwitt-emacsd thus
> tagging it as service to a certain user . Now although usually
> i am the sole user of my machine that setup seems misfit.


I agree

>
> So it seems logical to me at that point to have emacs as a user service.
> But as mentioned in (4) that even if i set seperate runsvdir to start
> for a user that would start before the user login. So emacs could not
> used for example XDG_RUNTIME_DIR to create a per user socket.
>
> So is it that runit does not support user services in a more
> complete level or there is a way to have user services start per user login event ?


This is true, and I think no other init system has an feature fully equivalent
to systemd --user.
For now I suggest you rely on something else to create the link/enable the
nested user-runsvdir on user login and remove the link on user logout.
For example many desktop have some "session configure panel" to set
components that are automatically started with the desktop at login; you can
run a script that creates the link from there.
Alternatively you can use pam_exec or /etc/profile.d/*.sh , to get an idea
see
https://unix.stackexchange.com/questions/87225/pam-action-on-unsuccessful-login

Not sure there is a proper way to run an action on logout..
None of the above looks satisfying to me but I'm afraid there is no
better way right now.

As a side note:
* I don't believe this feature belongs to an init system, but it would
be better to be
implemented as a set of init independent services that can be run by any init
that is capable of someting like runit's nested runsvdir
* I had an idea and started working on a draft last february but then
run out of time
and stopped, so nothing usable yet. I'll write on this list asking
for testers if/when
I finish that.

Lorenzo

>
>
>
>
>
> (1) https://dev1galaxy.org/viewtopic.php?pid=45961#p45961
> (2) My sources that i initially based my effort:
>     Lorenzo Puliti 's   runit-services  https://salsa.debian.org/Lorenzo.ru.g-guest/runit-services
>     Emacs daemon as a runit service by  Hristos N. Triantafillou  https://hristos.lol/blog/emacs-daemon-runit-service/
> (3) A hint in libera / #emacs  by <Viking667> to look at  $XDG_RUNTIME_DIR
> (4) https://www.reddit.com/r/voidlinux/comments/ign1eu/how_to_initiate_peruser_runit_services_after_login/
> (5) I used $ lsof -c emacs  or   $ ls -p PID
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng