unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Simon Josefsson via <help-guix@gnu.org>
To: help-guix@gnu.org
Subject: Ideas for unattened-upgrades 1) auto service restarts, 2) reboot when needed
Date: Wed, 23 Dec 2020 12:14:20 +0100	[thread overview]
Message-ID: <87o8iksrjn.fsf@latte.josefsson.org> (raw)

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

Thank you for unattended-upgrades!  Something like it has been my main
concern preventing deploying Guix on Internet-facing production
machines.

After using it for a while two things strikes me as useful improvements:

1) Automatically restarting all services.

I manually specified mcron, ntpd and ssh-daemon as the services to
restart, but this is not user friendly.  I just noticed I forgot
syslogd, nscd, guix-daemon and a bunch of others.

Two ideas for improvements, mostly intended as food for discussion:

1.a) Have an option that run 'herd restart X' for all of the running
services, probably except for some well-known system services that do
not have running processes related to them anyway.

I experimented with restarting all services mentioned by 'herd status',
but some do not like to be restarted (maybe this is a separate issue?):

root@hamster ~# herd restart device-mapping-/dev/md1
Service device-mapping-/dev/md1 has been stopped.
Service device-mapping-/dev/md1 could not be started.
root@hamster ~# herd start device-mapping-/dev/md1
Service device-mapping-/dev/md1 could not be started.
herd: failed to start service device-mapping-/dev/md1
root@hamster ~# 

The device was still present and the filesystem on it was mounted.

Further experimentation suggests the following should be excluded:
device-mapping* file-system* root*.

However, restarting some of others (including 'udev' and 'urandom-seed')
restarts almost everything else so it is a bit wasteful.

What do you think of this approach?  It would be a loop doing 'herd
restart X' on the service mentioned by 'herd status' except for some
well-known services.  Naturally, this should not be the default for now,
but require a new unattended-upgrades variable,
e.g. 'services-restart-all' set to true.

1.b)

Look at te running processes on the system, and figure out which
services started each, and restart each such service.  I don't know if
this is easily done.

2) Some upgrades requires a reboot for the effects to take place.  At
least this appears to includes the kernel and the transitive closure of
all libraries and binaries involved in shepherd (pid 1).  Libc upgrades
are probably possible to handle in user-space (except for sheperd) but I
believe other distributions reboot the machine on libc upgrades too.

Unattended-upgrades could be extended with a list of packages that it
should trigger a reboot for when they are upgraded.  Probably this
should also not be the default for now, but require another variable,
e.g., 'reboot-when-needed' set to true.

Btw, Happy holidays!

/Simon

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

                 reply	other threads:[~2020-12-23 11:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87o8iksrjn.fsf@latte.josefsson.org \
    --to=help-guix@gnu.org \
    --cc=simon@josefsson.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.
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).