From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 20 03:41:02 2018 Received: (at submit) by debbugs.gnu.org; 20 Aug 2018 07:41:02 +0000 Received: from localhost ([127.0.0.1]:55007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1freo9-0006mj-VQ for submit@debbugs.gnu.org; Mon, 20 Aug 2018 03:41:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1freo8-0006mI-Mt for submit@debbugs.gnu.org; Mon, 20 Aug 2018 03:41:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1freo2-0004zo-6L for submit@debbugs.gnu.org; Mon, 20 Aug 2018 03:40:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35188) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1freo2-0004za-1U for submit@debbugs.gnu.org; Mon, 20 Aug 2018 03:40:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frenx-00025q-SJ for bug-guix@gnu.org; Mon, 20 Aug 2018 03:40:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1freaK-0007ii-0F for bug-guix@gnu.org; Mon, 20 Aug 2018 03:26:46 -0400 Received: from mail-pl0-x22c.google.com ([2607:f8b0:400e:c01::22c]:44572) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1freaJ-0007iK-7T for bug-guix@gnu.org; Mon, 20 Aug 2018 03:26:43 -0400 Received: by mail-pl0-x22c.google.com with SMTP id ba4-v6so6649409plb.11 for ; Mon, 20 Aug 2018 00:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:user-agent:mime-version; bh=q8GKegxdcbIhc5kk90bDmcAxGaYe/pfZRVJcew8Ew1s=; b=IF6QySneIQbAv1FQbe8qYVOFIK/oXD7CH+2OPItQ2ZxihD0q22i1fBMKb3uXmTmZ/n RDcy+eQBqP74aXmFzGtZTxXUMl/AXN9q0U4abZJ0HrvFjF1etECz6HADXxxoWrX2YXoh NfViZk8LmY8cFVXaomMT2nU0C2iHuEKVJiHPeBX87Wy5grjkHn47dfOVwNZnFK+4Sfxw bxR2q69okefSzFWQCT+R+VuXDbWvGLCuiuVxgaD3fDqF8qgqvdM4iY6ut0OPP7/zbWPr 6h9AaRBsKVIKywEUD2wJdJhZyZ+y+ceXDrzH/A7eLiRh2P+9qZAPrlkTV8JnGvD/wBsk J1OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :mime-version; bh=q8GKegxdcbIhc5kk90bDmcAxGaYe/pfZRVJcew8Ew1s=; b=NL6xuPofMboTKi7h6iJe7plbXK7uiuN7ld8NWN+hSwxwwyYb7tSGIN4Et3TdCIloJL TIbT1v4IxHnoOj/uAS7kn8zi+xSuLnaRQ0neEuvyb1uGykC9dvoaskR1uAkdsICCw4Xu wePm17yyvB6cAcPW6zkKlOEDQQkI87bHDUxnBiuIv9aiDRJtIGTW/gq6kR2uFYmej7q7 Mx8VmobkSYbEURIJT9fR/bkkVzB/Kd5Vi3srF4fYQSc76I8n85eAqda+H3BhTQl8ocs9 of9pv3V4tf5ytQu+DfPYDOZLSCdX3vVFHNI8NSBpKAWLHTg03QBqItLgnZRmBxkystpv zZSQ== X-Gm-Message-State: AOUpUlFT3qb6DN0/t1ChwZPWIUkKaVzTC4CwK+VtpFd0Gsr/M4vcRAG9 +stryjGwIMTzXhTmUtPVlBHg+iBx X-Google-Smtp-Source: AA+uWPw3BHkn3HZNLkao7hblX97aYX2nVZGcT1PhREwk7IMfaVlGPYG+CEAY4ZeXbkea2PXEFAfHYQ== X-Received: by 2002:a17:902:7084:: with SMTP id z4-v6mr5374361plk.147.1534750001543; Mon, 20 Aug 2018 00:26:41 -0700 (PDT) Received: from garuda.local ([2601:602:9d02:4725:6495:ba21:1ebe:620a]) by smtp.gmail.com with ESMTPSA id y3-v6sm14886724pfi.24.2018.08.20.00.26.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Aug 2018 00:26:40 -0700 (PDT) From: Chris Marusich To: bug-guix@gnu.org Subject: pcscd service activation causes boot failure Date: Mon, 20 Aug 2018 00:26:38 -0700 Message-ID: <87pnyd8pn5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: Arun Isaac X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Commit de30205ba0f63eb987097a9f47b6e4fd38cd9044 added a pcscd service (hooray!). However, its activation procedure doesn't always work. The system test passes, and the activation procedure works the first time you boot, but if you reboot, it will fail because the symlink it creates already exists. The attached patch fixes the problem. To reproduce the bug, use the attached operating system configuration file (bare-bones.scm), and run: guix system vm-image bare-bones.scm This takes a long time to finish (up to a few hours, depending on your system). Once it's done, copy the image out of the store: cp $the_store_path /tmp/qemu-image Then run it: sudo qemu-system-x86_64 -smp cpus=3D1 -net user -net nic,model=3Dvirtio -= enable-kvm -m 2048 /tmp/qemu-image=20 Observe how the VM boots successfully. Now log in as root (no password) and reboot. Observe that the boot process fails now because the symlink created by the pcscd activation service already exists. 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): =2D-8<---------------cut here---------------start------------->8--- loading '/gnu/store/f4ng1dlpm7q74vssbb049vpf2gvw3n3r-system/boot'... [ 2.175072] random: fast init done making '/gnu/store/f4ng1dlpm7q74vssbb049vpf2gvw3n3r-system' the current sys= tem.. . 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 Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. GNU Guile 2.2.3 Copyright (C) 1995-2017 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guix utils)> ,bt In gnu/build/linux-boot.scm: 530:13 22 (_) In unknown file: 21 (primitive-load "/gnu/store/f4ng1dlpm7q74vssbb049vpf2gv=C2=B7") In ice-9/eval.scm: 619:8 20 (_ #f) In unknown file: 19 (primitive-load "/gnu/store/b6yg0pkp835a3zky9sj53yyjxac=C2=B7") In ice-9/boot-9.scm: 260:13 18 (for-each # _) In unknown file: 17 (primitive-load "/gnu/store/v42zaw2hjwxy5wnd0dwa6j245nr=C2=B7") In ice-9/eval.scm: 721:20 16 (primitive-eval (begin (use-modules (guix build #) #) =C2=B7)) In ice-9/psyntax.scm: 1235:36 15 (expand-top-sequence ((begin (use-modules (# # =C2=B7) =C2=B7)= =C2=B7)) =C2=B7) 1182:24 14 (parse _ (("placeholder" placeholder)) ((top) #(# # =C2=B7)) = =C2=B7) 1182:24 13 (parse _ (("placeholder" placeholder)) ((top) #(# # =C2=B7)) = =C2=B7) 285:10 12 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) =C2= =B7) In ice-9/boot-9.scm: 3365:20 11 (process-use-modules _) 222:29 10 (map1 (((guix build utils)) ((guix utils)))) 222:17 9 (map1 (((guix utils)))) 3366:31 8 (_ ((guix utils))) 2788:17 7 (resolve-interface (guix utils) #:select _ #:hide _ # _ =C2=B7) 2714:10 6 (_ (guix utils) _ _ #:ensure _) 2982:16 5 (try-module-autoload _ _) 2312:4 4 (save-module-excursion #) 3002:22 3 (_) In unknown file: 2 (primitive-load-path "guix/utils" #) In guix/utils.scm: 485:24 1 (_) In unknown file: 0 (dynamic-func "strverscmp" #) scheme@(guix utils)> [ 53.048203] random: crng init done =2D-8<---------------cut here---------------end--------------->8--- To be clear, the above stack trace is NOT related to the bug I am reporting. It's just a different problem that made it difficult to re-use switch-symlinks from (guix utils), which is why in my fix I decided to just copy the switch-symlinks definition verbatim. =2D-=20 Chris --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=bare-bones.scm Content-Transfer-Encoding: base64 OzsgVGhpcyBpcyBhbiBvcGVyYXRpbmcgc3lzdGVtIGNvbmZpZ3VyYXRpb24gdGVtcGxhdGUKOzsg Zm9yIGEgImJhcmUgYm9uZXMiIHNldHVwLCB3aXRoIG5vIFgxMSBkaXNwbGF5IHNlcnZlci4KCih1 c2UtbW9kdWxlcyAoZ251KSkKKHVzZS1zZXJ2aWNlLW1vZHVsZXMgbmV0d29ya2luZyBzc2ggc2Vj dXJpdHktdG9rZW4pCih1c2UtcGFja2FnZS1tb2R1bGVzIHNjcmVlbiBzc2gpCgoob3BlcmF0aW5n LXN5c3RlbQogIChob3N0LW5hbWUgImtvbXB1dGlsbyIpCiAgKHRpbWV6b25lICJFdXJvcGUvQmVy bGluIikKICAobG9jYWxlICJlbl9VUy51dGY4IikKCiAgOzsgQm9vdCBpbiAibGVnYWN5IiBCSU9T IG1vZGUsIGFzc3VtaW5nIC9kZXYvc2RYIGlzIHRoZQogIDs7IHRhcmdldCBoYXJkIGRpc2ssIGFu ZCAibXktcm9vdCIgaXMgdGhlIGxhYmVsIG9mIHRoZSB0YXJnZXQKICA7OyByb290IGZpbGUgc3lz dGVtLgogIChib290bG9hZGVyIChib290bG9hZGVyLWNvbmZpZ3VyYXRpb24KICAgICAgICAgICAg ICAgIChib290bG9hZGVyIGdydWItYm9vdGxvYWRlcikKICAgICAgICAgICAgICAgICh0YXJnZXQg Ii9kZXYvc2RYIikpKQogIChmaWxlLXN5c3RlbXMgKGNvbnMgKGZpbGUtc3lzdGVtCiAgICAgICAg ICAgICAgICAgICAgICAgIChkZXZpY2UgKGZpbGUtc3lzdGVtLWxhYmVsICJteS1yb290IikpCiAg ICAgICAgICAgICAgICAgICAgICAgIChtb3VudC1wb2ludCAiLyIpCiAgICAgICAgICAgICAgICAg ICAgICAgICh0eXBlICJleHQ0IikpCiAgICAgICAgICAgICAgICAgICAgICAlYmFzZS1maWxlLXN5 c3RlbXMpKQoKICA7OyBUaGlzIGlzIHdoZXJlIHVzZXIgYWNjb3VudHMgYXJlIHNwZWNpZmllZC4g IFRoZSAicm9vdCIKICA7OyBhY2NvdW50IGlzIGltcGxpY2l0LCBhbmQgaXMgaW5pdGlhbGx5IGNy ZWF0ZWQgd2l0aCB0aGUKICA7OyBlbXB0eSBwYXNzd29yZC4KICAodXNlcnMgKGNvbnMgKHVzZXIt YWNjb3VudAogICAgICAgICAgICAgICAgKG5hbWUgImFsaWNlIikKICAgICAgICAgICAgICAgIChj b21tZW50ICJCb2IncyBzaXN0ZXIiKQogICAgICAgICAgICAgICAgKGdyb3VwICJ1c2VycyIpCgog ICAgICAgICAgICAgICAgOzsgQWRkaW5nIHRoZSBhY2NvdW50IHRvIHRoZSAid2hlZWwiIGdyb3Vw CiAgICAgICAgICAgICAgICA7OyBtYWtlcyBpdCBhIHN1ZG9lci4gIEFkZGluZyBpdCB0byAiYXVk aW8iCiAgICAgICAgICAgICAgICA7OyBhbmQgInZpZGVvIiBhbGxvd3MgdGhlIHVzZXIgdG8gcGxh eSBzb3VuZAogICAgICAgICAgICAgICAgOzsgYW5kIGFjY2VzcyB0aGUgd2ViY2FtLgogICAgICAg ICAgICAgICAgKHN1cHBsZW1lbnRhcnktZ3JvdXBzICcoIndoZWVsIgogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgImF1ZGlvIiAidmlkZW8iKSkKICAgICAgICAgICAgICAg IChob21lLWRpcmVjdG9yeSAiL2hvbWUvYWxpY2UiKSkKICAgICAgICAgICAgICAgJWJhc2UtdXNl ci1hY2NvdW50cykpCgogIDs7IEdsb2JhbGx5LWluc3RhbGxlZCBwYWNrYWdlcy4KICAocGFja2Fn ZXMgKGNvbnMqIHNjcmVlbiBvcGVuc3NoICViYXNlLXBhY2thZ2VzKSkKCiAgOzsgQWRkIHNlcnZp Y2VzIHRvIHRoZSBiYXNlbGluZTogYSBESENQIGNsaWVudCBhbmQKICA7OyBhbiBTU0ggc2VydmVy LgogIChzZXJ2aWNlcyAoY29ucyogKHNlcnZpY2UgcGNzY2Qtc2VydmljZS10eXBlKQogICAgICAg ICAgICAgICAgICAgJWJhc2Utc2VydmljZXMpKSkK --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-services-Fix-pcscd-activation-bug.patch Content-Transfer-Encoding: quoted-printable From=203fa1e930b827aebca2dbbfe84c36cf203f15afda Mon Sep 17 00:00:00 2001 From: Chris Marusich 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 t= he /var/lib/pcsc symlink so that it does not fail when it already exists. =2D-- gnu/services/security-token.scm | 36 +++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/gnu/services/security-token.scm b/gnu/services/security-token.= scm index 7e7ea54a5..8bea49538 100644 =2D-- a/gnu/services/security-token.scm +++ b/gnu/services/security-token.scm @@ -20,6 +20,7 @@ #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (gnu packages admin) + #:use-module (gnu packages base) #:use-module (gnu packages security-token) #:use-module (gnu system shadow) #:use-module (guix gexp) @@ -62,14 +63,33 @@ (define pcscd-activation (match-lambda (($ pcsc-lite usb-drivers) =2D #~(begin =2D (use-modules (guix build utils)) =2D (mkdir-p "/var/lib") =2D (symlink #$(directory-union =2D "pcsc" =2D (map (cut file-append <> "/pcsc") =2D usb-drivers)) =2D "/var/lib/pcsc"))))) + (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))) + (mkdir-p "/var/lib") + (switch-symlinks "/var/lib/pcsc" + #$(directory-union + "pcsc" + (map (cut file-append <> "/pcsc") + usb-drivers)))))))) =20 (define pcscd-service-type (service-type =2D-=20 2.18.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlt6bS8ACgkQ3UCaFdgi Rp1TDhAAtOXQSrGlwYGbLY9mqlnyZ4CIhuI62WL0KiOBbF2SzV5oyqWW4415vjM3 cFIGkWMaEi+8Nf/8yI9w45MiO/wc6TXGYdpntwEAQOE3cLdPZftYkOhxpcaqWQaj 2X/SbF4/QHFw4lCQZfOiSX+y8RIUwAil2nYl7N08Do6yBXvJ/0/u/++mRuRSWni2 4uWLH39kg2vA2kFEY8QfvkHbITUkpmYR++eiY+Qux+scKYmigfhqacCyNL0Mkp8r +JpMvt7UxlDSxRyV6smxpHwFuumffs8+tuuoso2xZ5rVMrc3M9yFhZm51vnYg0kp eUBXZ5Xlk/BNMQw64BaVjvoC7v0NiRedBmyPJbSc/mwv5kdYPbHERry6d9dl8zFB n0iTiVd2x7uWlal+NcrLKN+pozQHrJPd5snPV4A4OhzCIopKLrIjWFqkrb3r3O3C e8/zKlNKgxsN3NMyXPrCog+sZx1pHULRSY+StLQEIMrtE6qujy/e+L/XrCFcuNAo bcxu11XWLNqd/PlvXJPTdiZ52xCu1+A3I+ULFq+s6mLjelVNNiGzK9Ek9huagw8z T1WlEgfif//aCZP+DCYYkQK8JvUlNXM1awgt4V7HVAE7C9A4nVmiAzsgBl23+G8o lZRCELPaY3fZwBCNrRT8rA9C4t57gvKuGybWziPN6N2QZAFbU6s= =ReTZ -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 20 12:13:37 2018 Received: (at 32478) by debbugs.gnu.org; 20 Aug 2018 16:13:37 +0000 Received: from localhost ([127.0.0.1]:55800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frmoD-0004iG-Dh for submit@debbugs.gnu.org; Mon, 20 Aug 2018 12:13:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frmoB-0004i3-Q8 for 32478@debbugs.gnu.org; Mon, 20 Aug 2018 12:13:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frmo2-0001eQ-U1 for 32478@debbugs.gnu.org; Mon, 20 Aug 2018 12:13:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frmo2-0001eB-Nx; Mon, 20 Aug 2018 12:13:26 -0400 Received: from [193.50.110.186] (port=60652 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1frmo2-00051W-BR; Mon, 20 Aug 2018 12:13:26 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Chris Marusich Subject: Re: bug#32478: pcscd service activation causes boot failure References: <87pnyd8pn5.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 3 Fructidor an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 20 Aug 2018 18:13:25 +0200 In-Reply-To: <87pnyd8pn5.fsf@gmail.com> (Chris Marusich's message of "Mon, 20 Aug 2018 00:26:38 -0700") Message-ID: <87bm9xdniy.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32478 Cc: 32478@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Hello, Chris Marusich 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 s= ystem.. > . > 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 =E2=80=9Cbuild side=E2=80=9D (a misnomer in this ca= se, but you see what I mean ;-)). Here, it assumes that dlopen support is available but it=E2=80=99s not because the activation snippet runs on the statically-linked Guile. > From 3fa1e930b827aebca2dbbfe84c36cf203f15afda Mon Sep 17 00:00:00 2001 > From: Chris Marusich > 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, bu= t 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", th= en > + ;; 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 =E2=80=9CTODO: Deduplicate=E2=80=9D would be enough as a comment, o= r at least something more concise like =E2=80=9CXXX: We cannot use (guix utils) becaus= e it requires a dynamically-linked Guile, hence the duplicate =E2=80=98switch-symlinks=E2=80=99.=E2=80=9D I leave it up to you! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 20 16:04:34 2018 Received: (at 32478) by debbugs.gnu.org; 20 Aug 2018 20:04:34 +0000 Received: from localhost ([127.0.0.1]:55912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frqPi-00023x-18 for submit@debbugs.gnu.org; Mon, 20 Aug 2018 16:04:34 -0400 Received: from vultr.systemreboot.net ([45.77.148.100]:41054 helo=systemreboot.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frqPg-00023h-BM for 32478@debbugs.gnu.org; Mon, 20 Aug 2018 16:04:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=fDu7ebQl9q7FehAAaw5mOtZnZJq0T8fTgFsGTlnL/J4=; b=MqYhc69F5vUNwjMnLHYkUtnuZ SiRMqzvNzdlibwWLfRmIqay5Gam5Cb57rv2sszA6WXVTQ7ZMoLlPJ2W/MxCN+i1g60HgcvGxI/e75 YMrQyTWvfxcNV8gk46H0TssuctwZQdWPFq8ZrVti1oOCZcZ3xNz6tb99tsxFM0OmMRCEg=; Received: from [124.40.246.228] (helo=steel) by systemreboot.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1frpvf-0000RJ-Qq; Tue, 21 Aug 2018 01:03:33 +0530 From: Arun Isaac To: Chris Marusich Subject: Re: pcscd service activation causes boot failure In-Reply-To: <87pnyd8pn5.fsf@gmail.com> References: <87pnyd8pn5.fsf@gmail.com> Date: Tue, 21 Aug 2018 01:03:23 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32478 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 32478@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Commit de30205ba0f63eb987097a9f47b6e4fd38cd9044 added a pcscd service > (hooray!). However, its activation procedure doesn't always work. The > system test passes, and the activation procedure works the first time > you boot, but if you reboot, it will fail because the symlink it creates > already exists. The attached patch fixes the problem. Thanks for catching and fixing this! I am still in the process of building and testing your patch. I ran out of memory and had to `guix gc' and rebuild again. As you said, it takes a while. But, your patch LGTM. Please go ahead and push to master at your discretion, after addressing Ludo's feedback. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 21 00:52:30 2018 Received: (at 32478-done) by debbugs.gnu.org; 21 Aug 2018 04:52:30 +0000 Received: from localhost ([127.0.0.1]:56110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fryeb-0000Kc-UJ for submit@debbugs.gnu.org; Tue, 21 Aug 2018 00:52:30 -0400 Received: from mail-pg1-f175.google.com ([209.85.215.175]:42956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fryea-0000KP-L2 for 32478-done@debbugs.gnu.org; Tue, 21 Aug 2018 00:52:28 -0400 Received: by mail-pg1-f175.google.com with SMTP id y4-v6so7865100pgp.9 for <32478-done@debbugs.gnu.org>; Mon, 20 Aug 2018 21:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=1rDKzVU9hnwkyPSl2HtQkrp4hlHb7rMwGDwWgi37oLM=; b=EzY1l0F7+fqqO4TDj6T6EnMX2sUrH0wgYTOJWUHMXsE7dOkSQm7/8aUJJI19FESNNp CWMPTG67m8vodBF8NVTZIIWwnuhi222s/jtdfERnC+8ZCKLtJ/c0CRuyqjGrXa0fvDs/ OS0RjmfFRuhvhwutCBvTwIrgI0BRqotIyGO3xM0CnAMeWxskIGnRc0fBHkJ0eeTK9nsr PkvsoQtLRzsDppJvlw0OSQlLFAfnSoeJtpj1B46jCnqkO8LTle07OTHghEcW6tfMgL6q aX08pP18+jFwtfcdPjGWFLSg/cphB6L3/UNBW9TRK0nesJgQktMwzSq1xggAm2zerHl3 BaHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=1rDKzVU9hnwkyPSl2HtQkrp4hlHb7rMwGDwWgi37oLM=; b=jwIrroPSvnjSLBgpsKBnKGHgCbDGPMMVafLtqaWf8GUX4k1AoZqLRz4C5eydEUzEER VQyUDHLd/nvpzsoIm3M6g9ME8f0N+WN3WVqPUKdgaWTni3JqoMWfghWXpH3Qv4xbuzWw xZMAMMCXz8pCkjRb3TMyUt6n9JczKKqE22SXCAsY4rkIBLYC596LTUc8BZFzP6Z1apE6 4bdtaze0rWYoDR/1tVvF/yfcD9a3VkGinrtFpSazvNnZD/8QqsqAcv1pqbD9H+QPfrZB t5qrgQFVCitZHaTbeEgbY+kiTUqPNu9rlYgi6FQqPrcf/SFui9GCBvfKtQ8DD1aws5a5 ZvCA== X-Gm-Message-State: AOUpUlGvg/qTzR0aT5xqgEeu22k/iVBhV/WjHLDPM9U8HZJX6XnVOo6P YIEt8weOkm+QPDojgsCv6m0= X-Google-Smtp-Source: AA+uWPwSo9dJ4B+UwnWtSoNR3RW9eaO0FUnbW5vf07GspapWHtMWHBy46Zvn66Gj/exNahcbV4VSRw== X-Received: by 2002:a62:5613:: with SMTP id k19-v6mr51234572pfb.212.1534827142572; Mon, 20 Aug 2018 21:52:22 -0700 (PDT) Received: from garuda.local ([2601:602:9d02:4725:6495:ba21:1ebe:620a]) by smtp.gmail.com with ESMTPSA id 82-v6sm17311199pfw.159.2018.08.20.21.52.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Aug 2018 21:52:20 -0700 (PDT) From: Chris Marusich To: 32478-done@debbugs.gnu.org Subject: Re: bug#32478: pcscd service activation causes boot failure References: <87pnyd8pn5.fsf@gmail.com> <87bm9xdniy.fsf@gnu.org> Date: Mon, 20 Aug 2018 21:52:19 -0700 In-Reply-To: <87bm9xdniy.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 20 Aug 2018 18:13:25 +0200") Message-ID: <87o9dwmid8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32478-done Cc: Arun Isaac , Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludo and Arun, ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> 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 =E2=80=9Cbuild side=E2=80=9D (a misnomer in this = case, but you > see what I mean ;-)). Here, it assumes that dlopen support is available > but it=E2=80=99s not because the activation snippet runs on the > statically-linked Guile. That makes sense. I keep forgetting about this. :-) Thank you for reminding me! > I think =E2=80=9CTODO: Deduplicate=E2=80=9D would be enough as a comment,= or at least > something more concise like =E2=80=9CXXX: We cannot use (guix utils) beca= use it > requires a dynamically-linked Guile, hence the duplicate > =E2=80=98switch-symlinks=E2=80=99.=E2=80=9D I leave it up to you! Yes, I agree. I'll simplify the comment. I included the long comment mainly in the hopes that somebody would be able to help me understand why it wasn't working. Arun Isaac writes: >> Commit de30205ba0f63eb987097a9f47b6e4fd38cd9044 added a pcscd service >> (hooray!). However, its activation procedure doesn't always work. The >> system test passes, and the activation procedure works the first time >> you boot, but if you reboot, it will fail because the symlink it creates >> already exists. The attached patch fixes the problem. > > Thanks for catching and fixing this! I am still in the process of > building and testing your patch. I ran out of memory and had to `guix > gc' and rebuild again. As you said, it takes a while. But, your patch > LGTM. Please go ahead and push to master at your discretion, after > addressing Ludo's feedback. OK! I've rewritten the comment as Ludo suggested and committed this to master as 6fb6ac6857df31c55a640eead2a5f79edd7dab14. Now, I'll close this bug report. =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlt7moMACgkQ3UCaFdgi Rp3kDw/+PuZNIir8BiOIIVmCdVNYC6Xr/GqSvEJd7XYb0sIc2hUbjnQwWVIZxCj8 WNQ0Lr1+ANIAPXFrP8+P4ayT21WBq7C5i+xIGMGN3+UqJ5omnAZboszoWIV0XSUS s4bJzOVFYMbCWQe1Hpj0h4TNbxZONzCrVMS2k34EJ15yaho5durRautd0TzRW5kY WrkSVrK5Kx6ZdbUJkH0DbHSPx0Yxk1eCsPXEK37WSqNPJHHf+JUcSy/4eaaxsJtq 9A5+xS4KTC48nMM0luYp/DIrDCnq30084eBFV9AAtildhEZe23nQjdTmTIl30+bA Hue/e4DyH76CulTs/LDMeHP0clYg3ocsorJxXQaajrXdEoG9hj2n2mWa8z/xf9Hv Msbpyi6HJuJImu4C6BI+e/X02f9eddALd4LMoQJ6eem31KxC4H45Aj1tn3Bqn8FL csCzj2KsSDJDhpk4caUJJdOVMNPQ9V7cR6xwCkGYHmRJp42Hd0mL+Du+73EfvkBF wdj4+HWt4t1SprlmwRC1R4ALHUU1Lk38Zn2b7Xf5HcheYXqlK/Zm83AxnrtzOKZT kRfc2nzdeOYqnkdZA7sEWh+/LAJpUxXxo6PGCy3MSSqOEwMQuOK1W/U3ATVJ+/hk JeGpexXiyPdvo9zb+JAy149QhNdJlXjqSspSZaiwIkM5Ue10wVY= =wt5f -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Sep 09 18:21:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 18 Sep 2018 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator