all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Efraim Flashner <efraim@flashner.co.il>
Cc: 31894@debbugs.gnu.org
Subject: [bug#31894] Containerize openntpd service
Date: Fri, 22 Jun 2018 21:39:01 +0200	[thread overview]
Message-ID: <87d0wiy5ka.fsf@gnu.org> (raw)
In-Reply-To: <20180619093155.GA1200@macbook41> (Efraim Flashner's message of "Tue, 19 Jun 2018 12:31:55 +0300")

Hello Efraim,

Efraim Flashner <efraim@flashner.co.il> skribis:

> I tested this patch with the included vm image, using the following
> script. After logging in, 'ntpctl -s all' shows openntpd connecting to
> the ntp servers and updating the time.
>
> /.$(./pre-inst-env guix environment guix -- ./pre-inst-env guix system vm ~/vm-image.scm) -m 768 -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5555-:53

[...]

> From 064903c5a976280b95cd9bba17e958e662be605d Mon Sep 17 00:00:00 2001
> From: Efraim Flashner <efraim@flashner.co.il>
> Date: Tue, 19 Jun 2018 12:24:47 +0300
> Subject: [PATCH] services: openntpd: Containerize openntpd service.
>
> * gnu/packages/ntp.scm (openntpd)[arguments]: Add 'privsep-path' to
> 'configure-flags and adjust the 'localstatedir' flag.
> * gnu/services/networking.scm (openntpd-shepherd-service): Change the
> start-service command to run in a container, expose '/var/log/openntpd'
> and '/var/lib/openntpd' to the container.
> (openntpd-service-activation): Adjust directories for the changes above.

Neat!  The patch LGTM, especially since you’ve confirmed that it still
works as expected.  :-)

One thing though: could you make sure containerization isn’t redundant
with what OpenNTPD already does?  Namely, could you grep the source for
calls to “chroot”, “unshare”, or “seccomp”?  If it happens to be already
doing one of these things, it may be that using a container brings
little or nothing.

If it’s OK, please push!

While I’m at it, one question about this comment (which was already there):

> +                           ;; When ntpd is daemonized it repeatedly tries to respawn
> +                           ;; while running, leading shepherd to disable it.  To
> +                           ;; prevent spamming stderr, redirect output to logfile.
> +                           #:log-file "/var/log/ntpd"))

What’s described here is expected: when it daemonizes, the initial
process that shepherd spawned terminates immediately, which is why
shepherd tries to respawn it (it cannot guess that there’s in fact a
child process that keeps running.)

The right thing to do for things that daemonize is to use the #:pid-file
option, which instructs shepherd to poll that file.  Should we do this
here?  There are many examples of that, including bitlbee, which is
containerized.

Thanks,
Ludo’.

  reply	other threads:[~2018-06-22 19:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19  9:31 [bug#31894] Containerize openntpd service Efraim Flashner
2018-06-22 19:39 ` Ludovic Courtès [this message]
2018-06-26  8:25   ` bug#31894: " Efraim Flashner
2018-06-26 13:48     ` [bug#31894] " Ludovic Courtès

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=87d0wiy5ka.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=31894@debbugs.gnu.org \
    --cc=efraim@flashner.co.il \
    /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.