From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo1M9-0006Fw-Q1 for guix-patches@gnu.org; Fri, 10 Aug 2018 02:57:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fo1M6-0002zp-O9 for guix-patches@gnu.org; Fri, 10 Aug 2018 02:57:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:41303) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fo1M6-0002z8-Hs for guix-patches@gnu.org; Fri, 10 Aug 2018 02:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fo1M6-0004wb-37 for guix-patches@gnu.org; Fri, 10 Aug 2018 02:57:02 -0400 Subject: [bug#32358] Add pcscd service Resent-Message-ID: From: Chris Marusich References: <87a7q2lqc6.fsf@garuda.local.i-did-not-set--mail-host-address--so-tickle-me> Date: Thu, 09 Aug 2018 23:56:26 -0700 In-Reply-To: (Arun Isaac's message of "Thu, 09 Aug 2018 19:55:59 +0530") Message-ID: <87zhxu7lr9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Arun Isaac Cc: 32358@debbugs.gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Arun, Thank you for the update! I'm having a little trouble testing this on my system due to the following unrelated bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28144 However, I'll keep trying and let you know once I've tested it out. For now, here's my feedback. Overall, this looks good to me. Mainly, I'd just like to test it before we commit it to master. If you're feeling up to it, it would be great to add a system test, but it's not necessary, and we could add it later. Arun Isaac writes: > +(define-module (gnu services security-token) > + #:use-module (gnu services) > + #:use-module (gnu services shepherd) > + #:use-module (gnu packages admin) > + #:use-module (gnu packages security-token) > + #:use-module (gnu system shadow) > + #:use-module (guix gexp) > + #:use-module (guix modules) > + #:use-module (guix records) > + #:use-module (ice-9 match) > + #:use-module (srfi srfi-26) > + #:export (pcscd-configuration > + pcscd-configuration? > + pcscd-service-type)) Shouldn't we also export pcscd-configuration-pcsc-lite and pcscd-configuration-usb-drivers? We allow users to set them when constructing the record, so it seems reasonable to allow users to get them, to. After all, if a user wants to construct a new from an existing (e.g., using "inherit"), they might need to be able to get the original values (e.g., to add more packages to the usb-drivers list). > +(define pcscd-shepherd-service > + (match-lambda > + (($ pcsc-lite) > + (with-imported-modules (source-module-closure > + '((gnu build shepherd))) > + (shepherd-service > + (documentation "PC/SC Smart Card Daemon") > + (provision '(pcscd)) > + (modules '((gnu build shepherd))) > + (start #~(make-forkexec-constructor > + (list #$(file-append pcsc-lite "/sbin/pcscd") "-f"))) > + (stop #~(make-kill-destructor))))))) Does this work as written? The make-forkexec-constructor and make-kill-destructor procedures are exported in (shepherd service), but it doesn't look like that module will be used, since it isn't in the modules list. If it does work, then I don't understand how (shepherd service) is getting used, so I'd be curious to know why it works! > +(define pcscd-activation > + (match-lambda > + (($ pcsc-lite usb-drivers) > + #~(begin > + (use-modules (guix build utils)) > + (mkdir-p "/var/lib") > + (symlink #$(directory-union > + "pcsc" > + (map (cut file-append <> "/pcsc") > + usb-drivers)) > + "/var/lib/pcsc"))))) What happens if the symlink target already exists? Will this crash the init process, or will the system come online and just report an error? Some people (such as myself) have already created this directory manually, so the directory might exist if they forget to delete it. > Subject: [PATCH 2/2] gnu: ccid: Move pcsc-lite from inputs to native-inpu= ts. Patch 2/2 looks good to me! =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlttNxoACgkQ3UCaFdgi Rp1QwxAAw+6mnoKiXFZwVZmWNeSysiPRwhdqnb9ST/V3XMPWtWVkMrkTLMubQgzk cNmzIg1ydjQdMqW7lUDQiwjSUa0UE+tx/lV4ua12rtgY8urLrASHxcIcUHjnMQTZ 2t77847gmAXaz2lyYUzrDXfcOTdqJ7Wx0Zbl64TYE0coryf4NSb3LeJlDXfiQcvt 7QUxYgZ/fakE/QxoyC53/8NwbUztWbG+IvLHc/hssI/ZTl3lvAF2LCYk+qvD3bQ5 o2uSYgZ4c01uxbhRB+OOMBxJwD/8TfKpsJG27CWEXnvhiTikDSqX7wREDff4ArpZ a/yYIfLC99fmRElRN9O6YKoG7S/u7uDB/2ALZR7gk7NPsDCKjGmLEUF760zrKOIU mCr/8E66xmR7Z2aUfJJDhr786/DZzSn3MIzF2oyk1KE+nVFh2mwxXcgWV03pNiM1 kYBcPBPJLsUoz7pTvBgZeWPHhheTKS8JyGN+hzBTCBD4Y7cCMzbLhzdMLIFX5V6s NPDfSU0DtHY/h80AlX6PGp9vr5Dt9DOpk/BHXJlAVcmD+PysHEZkS2o/nKUxaBED TWBLEZoppbpIrljkTKmoSpV6e7RCm5PkaCc//TvS0BcaLA+JwUSdOHb4RilmixoX Imgpnq3BHk7uIeWAwip0dV18/qDnRMhp47JPaYUQMPkJ97o+W2Q= =Eqhv -----END PGP SIGNATURE----- --=-=-=--