all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: guix-devel@gnu.org, Carlo Zancanaro <carlo@zancanaro.id.au>
Subject: Re: Improving Shepherd
Date: Fri, 09 Feb 2018 14:22:09 +0100	[thread overview]
Message-ID: <874lmq2t8e.fsf@gnu.org> (raw)
In-Reply-To: <20180205170011.73780f13@scratchpost.org> (Danny Milosavljevic's message of "Mon, 5 Feb 2018 17:00:11 +0100")

Hey!

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> On Mon, 05 Feb 2018 21:49:08 +1100
> Carlo Zancanaro <carlo@zancanaro.id.au> wrote:
>
>> User services - Alex has already sent a patch to the list to allow 
>> generating user services from the Guix side. The idea is to 
>> generate a Shepherd config file, allowing a user to invoke 
>> shepherd manually to start their services.
>
>>A further extension to 
>> this would be to have something like systemd's "user sessions", 
>> where the pid 1 Shepherd automatically starts a user's services 
>> when they log in.
>
> I assume that means "starts a user's shepherd when they log in".
>
> elogind already emits a signal on dbus which tells you when a user logged in
>
>         return sd_bus_emit_signal(
>                         u->manager->bus,
>                         "/org/freedesktop/login1",
>                         "org.freedesktop.login1.Manager",
>                         new_user ? "UserNew" : "UserRemoved",
>                         "uo", (uint32_t) u->uid, p);

I think there’s Guile D-Bus client though.  Another yak to shave…

> Also, a directory /run/user/<id> appears - which alternatively can be
> monitored by inotify or something.
>
> So the system shepherd could have a shepherd service which does
>
>   while (1) {
>      wait until /run/user/<id> appears
>      vfork
>        if child: setuid, exec user shepherd, _exit
>        if parent: wait until child dies
>   }
>
> We better be sure that no one else can create directories in /run/user .
>
> In non-pseudocode, both "wait until /run/user/<id> appears" and
> "wait until child dies" would have to be in the same call,
> maybe epoll or something.

Yes, inotify (ISTR there *are* inotify bindings for Guile somewhere.)

> Maybe call the service shepherd-nursery-service or something, like a star
> nursery :)

:-)

Ludo’.

  parent reply	other threads:[~2018-02-09 13:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29 21:14 Improving Shepherd Carlo Zancanaro
2018-01-29 22:27 ` Jelle Licht
2018-02-05 10:49 ` Carlo Zancanaro
2018-02-05 13:08   ` Ludovic Courtès
2018-02-05 15:56     ` Carlo Zancanaro
2018-02-09 13:26       ` Ludovic Courtès
2018-02-09 19:50         ` Carlo Zancanaro
2018-02-09 21:32         ` Christopher Lemmer Webber
2018-02-14 13:10           ` Ludovic Courtès
2018-02-15 13:55             ` Andy Wingo
2018-02-10 13:34     ` Jelle Licht
2018-02-14 13:25       ` Ludovic Courtès
2018-02-15 17:05         ` Jelle Licht
2018-02-15 19:04           ` Mark H Weaver
2018-02-05 16:00   ` Danny Milosavljevic
2018-02-05 16:41     ` Carlo Zancanaro
2018-02-09 13:22     ` Ludovic Courtès [this message]
2018-02-09 20:51       ` David Pirotte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874lmq2t8e.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=carlo@zancanaro.id.au \
    --cc=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.