GNU bug report logs - #32358
Add pcscd service

Previous Next

Package: guix-patches;

Reported by: Arun Isaac <arunisaac <at> systemreboot.net>

Date: Fri, 3 Aug 2018 10:24:01 UTC

Severity: normal

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 32358 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Chris Marusich <cmmarusich <at> gmail.com>
Cc: 32358 <at> debbugs.gnu.org
Subject: Re: [bug#32358] Add pcscd service
Date: Sun, 12 Aug 2018 13:55:52 +0530
> 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=28144
>
> However, I'll keep trying and let you know once I've tested it out.

Sure, no problem.

> 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.

I'm ok with adding a system test right now. But, what kind of test? Can
you elaborate on any ideas you have?

> Shouldn't we also export pcscd-configuration-pcsc-lite and
> pcscd-configuration-usb-drivers?

Sure, will do.

>> +(define pcscd-shepherd-service
>> +  (match-lambda
>> +    (($ <pcscd-configuration> 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!

Yes, the service does work. But, I don't really know why. I copied this
bit of code from some other service and modified it incrementally until
it did what I wanted. :-P So, I'm not super-clear what exactly is
happening here.

>> +(define pcscd-activation
>> +  (match-lambda
>> +    (($ <pcscd-configuration> 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.

When the symlink already exists, the system reconfigures properly, but
reports an error. You will have to delete your existing /var/lib/pcsc
symlink before reconfiguring.

>> Subject: [PATCH 2/2] gnu: ccid: Move pcsc-lite from inputs to native-inputs.
>
> Patch 2/2 looks good to me!

I pushed this patch alone to master.




This bug report was last modified 6 years and 337 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.