unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Starting user services at boot
@ 2017-02-12 19:54 Leo Famulari
  2017-02-13  9:30 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Leo Famulari @ 2017-02-12 19:54 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

Does anyone have advice about how to start an unprivileged user's
services when the system boots?

On other systems, I could at least invoke them in /etc/rc.local, but I'm
not sure how to do it on GuixSD.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting user services at boot
  2017-02-12 19:54 Starting user services at boot Leo Famulari
@ 2017-02-13  9:30 ` Ludovic Courtès
  2017-02-13 12:37   ` ng0
  2017-02-15 11:14   ` Alex Kost
  0 siblings, 2 replies; 5+ messages in thread
From: Ludovic Courtès @ 2017-02-13  9:30 UTC (permalink / raw)
  To: Leo Famulari; +Cc: help-guix

Hi Leo!

Leo Famulari <leo@famulari.name> skribis:

> Does anyone have advice about how to start an unprivileged user's
> services when the system boots?
>
> On other systems, I could at least invoke them in /etc/rc.local, but I'm
> not sure how to do it on GuixSD.

Currently I run shepherd as myself, which reads from
~/.config/shepherd/init.scm.  It gets started from my ~/.xsession.

Admittedly this is a bit of a hack.  It wouldn’t be hard to define
per-user Shepherd instances as global Shepherd services in GuixSD, if
you see what I mean.

Another option would be to add support for this directly in the
Shepherd, which has pros and cons.

HTH!

Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting user services at boot
  2017-02-13  9:30 ` Ludovic Courtès
@ 2017-02-13 12:37   ` ng0
  2017-02-13 14:01     ` Ludovic Courtès
  2017-02-15 11:14   ` Alex Kost
  1 sibling, 1 reply; 5+ messages in thread
From: ng0 @ 2017-02-13 12:37 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix

On 17-02-13 10:30:10, Ludovic Courtès wrote:
> Hi Leo!
> 
> Leo Famulari <leo@famulari.name> skribis:
> 
> > Does anyone have advice about how to start an unprivileged user's
> > services when the system boots?
> >
> > On other systems, I could at least invoke them in /etc/rc.local, but I'm
> > not sure how to do it on GuixSD.
> 
> Currently I run shepherd as myself, which reads from
> ~/.config/shepherd/init.scm.  It gets started from my ~/.xsession.
> 
> Admittedly this is a bit of a hack.  It wouldn’t be hard to define
> per-user Shepherd instances as global Shepherd services in GuixSD, if
> you see what I mean.
> 
> Another option would be to add support for this directly in the
> Shepherd, which has pros and cons.

What are the pros and cons from your point of view, could you explain this?
 
> HTH!
> 
> Ludo’.
> 

-- 
ng0 -- https://www.inventati.org/patternsinthechaos/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting user services at boot
  2017-02-13 12:37   ` ng0
@ 2017-02-13 14:01     ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2017-02-13 14:01 UTC (permalink / raw)
  To: Leo Famulari; +Cc: help-guix

ng0 <contact.ng0@cryptolab.net> skribis:

> On 17-02-13 10:30:10, Ludovic Courtès wrote:
>> Hi Leo!
>> 
>> Leo Famulari <leo@famulari.name> skribis:
>> 
>> > Does anyone have advice about how to start an unprivileged user's
>> > services when the system boots?
>> >
>> > On other systems, I could at least invoke them in /etc/rc.local, but I'm
>> > not sure how to do it on GuixSD.
>> 
>> Currently I run shepherd as myself, which reads from
>> ~/.config/shepherd/init.scm.  It gets started from my ~/.xsession.
>> 
>> Admittedly this is a bit of a hack.  It wouldn’t be hard to define
>> per-user Shepherd instances as global Shepherd services in GuixSD, if
>> you see what I mean.
>> 
>> Another option would be to add support for this directly in the
>> Shepherd, which has pros and cons.
>
> What are the pros and cons from your point of view, could you explain this?

The downside is that it would make the Shepherd more complex: it would
have to have a built-in notion of user instances, even though it is not
designed specifically to run as PID 1 initially (you can use it as an
unprivileged user already).

Another downside is that /var/run/shepherd/socket may need to be
accessible to users so they can talk to PID 1.  More generally, there’d
need to be some way to prevent unprivileged users from doing things like
running arbitrary code in PID 1.

The upside would be better integration: if shepherd knows about user
services, then it can show them in ‘herd status’, things like that.

(There’s a similar trade-off for the recently-added support for services
running in containers.)

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting user services at boot
  2017-02-13  9:30 ` Ludovic Courtès
  2017-02-13 12:37   ` ng0
@ 2017-02-15 11:14   ` Alex Kost
  1 sibling, 0 replies; 5+ messages in thread
From: Alex Kost @ 2017-02-15 11:14 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix

Ludovic Courtès (2017-02-13 10:30 +0100) wrote:

> Hi Leo!
>
> Leo Famulari <leo@famulari.name> skribis:
>
>> Does anyone have advice about how to start an unprivileged user's
>> services when the system boots?
>>
>> On other systems, I could at least invoke them in /etc/rc.local, but I'm
>> not sure how to do it on GuixSD.
>
> Currently I run shepherd as myself, which reads from
> ~/.config/shepherd/init.scm.  It gets started from my ~/.xsession.

I do the same but in ~/.bash-profile like this:

# Start shepherd if it is not already running.
[[ -z $(pgrep -U $(id --user) "^shepherd$") ]] \
    && shepherd &>> $HOME/.config/shepherd/shepherd.log

-- 
Alex

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-15 11:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-12 19:54 Starting user services at boot Leo Famulari
2017-02-13  9:30 ` Ludovic Courtès
2017-02-13 12:37   ` ng0
2017-02-13 14:01     ` Ludovic Courtès
2017-02-15 11:14   ` Alex Kost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).