all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Chris Marusich <cmmarusich@gmail.com>
Cc: 32478@debbugs.gnu.org
Subject: bug#32478: pcscd service activation causes boot failure
Date: Mon, 20 Aug 2018 18:13:25 +0200	[thread overview]
Message-ID: <87bm9xdniy.fsf@gnu.org> (raw)
In-Reply-To: <87pnyd8pn5.fsf@gmail.com> (Chris Marusich's message of "Mon, 20 Aug 2018 00:26:38 -0700")

Hello,

Chris Marusich <cmmarusich@gmail.com> skribis:

> The attached patch fixes the issue by using an idempotent procedure to
> create the symlink.  If there are no objections, I'll push the patch to
> master about 24 hours from now.  There is a fairly long comment in my
> patch because although I wanted to re-use the switch-symlinks procedure
> from (guix utils), I couldn't figure out how to do it.  Ideas regarding
> this are welcome!  To be specific, I tried to use (guix utils), but then
> I got the following error message at boot time (see my comment for more
> information):
>
> loading '/gnu/store/f4ng1dlpm7q74vssbb049vpf2gvw3n3r-system/boot'...
> [    2.175072] random: fast init done
> making '/gnu/store/f4ng1dlpm7q74vssbb049vpf2gvw3n3r-system' the current system..
> .
> setting up setuid programs in '/run/setuid-programs'...
> populating /etc from /gnu/store/n6cwz1hlmjylva2xrv61njl68g6c8k5l-etc...
> usermod: no changes
> usermod: no changes
> usermod: no changes
> ERROR: In procedure dynamic-func:
> In procedure dynamic-pointer: Symbol not found: strverscmp

This is because (guix utils) pulls in lots of things that are not really
meant to be used on the “build side” (a misnomer in this case, but you
see what I mean ;-)).  Here, it assumes that dlopen support is available
but it’s not because the activation snippet runs on the
statically-linked Guile.

> From 3fa1e930b827aebca2dbbfe84c36cf203f15afda Mon Sep 17 00:00:00 2001
> From: Chris Marusich <cmmarusich@gmail.com>
> Date: Mon, 20 Aug 2018 00:16:06 -0700
> Subject: [PATCH] gnu: services: Fix pcscd activation bug.
>
> * gnu/services/security-token.scm (pcscd-activation): Idempotently create the
> /var/lib/pcsc symlink so that it does not fail when it already exists.

LGTM!

> +     (with-imported-modules (source-module-closure
> +                             '((guix build utils)))
> +       #~(begin
> +           (use-modules (guix build utils))
> +           ;; This switch-symlinks procedure was copied from (guix utils).  It
> +           ;; would be nice to re-use the procedure from that module, but if
> +           ;; we add that module to this gexp's imported modules and try to
> +           ;; use it, then this activation gexp can fail when it runs.  To be
> +           ;; specific, if you try to use (guix utils) and then build a VM
> +           ;; with a pcscd-service-type using "guix system vm-image", then
> +           ;; when you boot the VM, it will fail.  It fails because (guix
> +           ;; utils) dynamically links glibc's strverscmp function when
> +           ;; defining the version-compare procedure, and for some reason
> +           ;; strverscmp can't be found.  Perhaps there's a way to fix or
> +           ;; avoid this, but since we don't need the version-compare
> +           ;; procedure here, anyway, it's simpler to just define our own
> +           ;; switch-symlinks procedure instead.
> +           (define (switch-symlinks link target)
> +             (let ((pivot (string-append link ".new")))
> +               (symlink target pivot)
> +               (rename-file pivot link)))

I think “TODO: Deduplicate” would be enough as a comment, or at least
something more concise like “XXX: We cannot use (guix utils) because it
requires a dynamically-linked Guile, hence the duplicate
‘switch-symlinks’.”  I leave it up to you!

Thanks,
Ludo’.

  reply	other threads:[~2018-08-20 16:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20  7:26 bug#32478: pcscd service activation causes boot failure Chris Marusich
2018-08-20 16:13 ` Ludovic Courtès [this message]
2018-08-21  4:52   ` Chris Marusich
2018-08-20 19:33 ` Arun Isaac

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=87bm9xdniy.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=32478@debbugs.gnu.org \
    --cc=cmmarusich@gmail.com \
    /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.