Artix Linux Forum

General Category => Other distros => Topic started by: Phoen7x on 27 January 2019, 21:45:47

Title: PGP-Smartcard with OpenRC
Post by: Phoen7x on 27 January 2019, 21:45:47
I couldn't find any  pcsclite-openrc package to enable the daemon.

In the Arch-Wiki (https://wiki.archlinux.org/index.php/GnuPG#Smartcards) this seems to be needed.

I'm unable to connect with my USB-PGP-Smartcard
Title: Re: PGP-Smartcard with OpenRC
Post by: nous on 27 January 2019, 22:18:44
Try this and report back.
Code: [Select]
#!/usr/bin/openrc-run
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

name="PC/SC Daemon"

pidfile=/run/pcscd/pcscd.pid

command=/usr/bin/pcscd
command_args="${EXTRA_OPTS}"

start_stop_daemon_args="--user pcscd:pcscd"

depend() {
need localmount
after udev openct dbus
use logger
}

start_pre() {
checkpath -d -m 0755 -o pcscd:pcscd /run/pcscd
}
Title: Re: PGP-Smartcard with OpenRC
Post by: Phoen7x on 27 January 2019, 22:45:33
Thank you for your response.

I don't know what to do?  ::)

This seems to be a shell-skript but where should I copy this?
/usr/bin/openrc-run is not in a readable format.
Title: Re: PGP-Smartcard with OpenRC
Post by: nous on 27 January 2019, 23:27:57
Copy it as /etc/init.d/pcsclite and chmod +x it. Then rc-service pcsclite start.
Title: Re: PGP-Smartcard with OpenRC
Post by: artoo on 28 January 2019, 00:52:16
I'll add pcsclite to our galaxy repo along with the openrc package.
Konimex adds the runit package when he has time.
Title: Re: PGP-Smartcard with OpenRC
Post by: Phoen7x on 28 January 2019, 13:00:33

Didn't work. :(
Code: [Select]
$ sudo rc-service pcsclite start
 * Caching service dependencies ...                                                                              [ ok ]
 * checkpath: owner `pcscd:pcscd' not found
 * ERROR: pcsclite failed to start
Title: Re: PGP-Smartcard with OpenRC
Post by: artoo on 28 January 2019, 13:46:08
Didn't work. :(
Code: [Select]
$ sudo rc-service pcsclite start
 * Caching service dependencies ...                                                                              [ ok ]
 * checkpath: owner `pcscd:pcscd' not found
 * ERROR: pcsclite failed to start


Could you please comment out the start_pre() function and report back?

Code: [Select]
#start_pre() {
# checkpath -d -m 0755 -o pcscd:pcscd /run/pcscd
#}

Alternatively, could you try, either create a pcscd group and user, or set it to an existing user/group.

We'll improve the script, the package is in repos
Title: Re: PGP-Smartcard with OpenRC
Post by: Phoen7x on 28 January 2019, 14:24:03
Could you please comment out the start_pre() function and report back?
Code: [Select]
 * Caching service dependencies ...                                                                                                [ ok ]
 * Starting PC/SC Daemon ...
 * start-stop-daemon: user `pcscd' not found
 * Failed to start PC/SC Daemon                                                                                                      [ !! ]
 * ERROR: pcsclite failed to start

Quote
Alternatively, could you try, either create a pcscd group and user, or set it to an existing user/group.
We'll improve the script, the package is in repos
In wich groups must be the user?
Title: Re: PGP-Smartcard with OpenRC
Post by: nous on 28 January 2019, 18:13:08
If you're the only user in the machine, your user and primary group will be fine.
Title: Re: PGP-Smartcard with OpenRC
Post by: Phoen7x on 28 January 2019, 18:24:50
If you're the only user in the machine, your user and primary group will be fine.
Fails also:
Code: [Select]
 * Caching service dependencies ...                                                                                          [ ok ]
 * /run/pcscd: correcting owner
 * Starting PC/SC Daemon ...
 * start-stop-daemon: user `pcscd' not found
 * Failed to start PC/SC Daemon                                                                                               [ !! ]
 * ERROR: pcsclite failed to start
seems that it is needed to install the user pcscd?
Title: Re: PGP-Smartcard with OpenRC
Post by: artoo on 28 January 2019, 19:23:29
Please the script you put manually and install pcsclite-openrc.

You find a config file in /etc/conf.d/pcscd in case the default user:group setting doesn't work.
Title: Re: PGP-Smartcard with OpenRC
Post by: Phoen7x on 28 January 2019, 21:56:01
Please the script you put manually and install pcsclite-openrc.
You find a config file in /etc/conf.d/pcscd in case the default user:group setting doesn't work.
Unfortunately, I can not install this package because I have freed my system and Artixlinux merely serves as a base.
I must wait until parabola (https://parabola.nu) add the package (https://labs.parabola.nu/issues/2154).
I tried to install the package manually, but I get the error: Invalid or corrupted package (PGP signature) even though I imported the key when I polled.
Title: Re: PGP-Smartcard with OpenRC
Post by: artoo on 29 January 2019, 00:03:02
Unfortunately, I can not install this package because I have freed my system and Artixlinux merely serves as a base.
I must wait until parabola (https://parabola.nu) add the package (https://labs.parabola.nu/issues/2154).
I tried to install the package manually, but I get the error: Invalid or corrupted package (PGP signature) even though I imported the key when I polled.


so we are doing support for parabola here?
I mean seriously, we are really thin in manpower...
Title: Re: PGP-Smartcard with OpenRC
Post by: nous on 29 January 2019, 00:10:56
Fails also:
Code: [Select]
 * Caching service dependencies ...                                                                                          [ ok ]
 * /run/pcscd: correcting owner
 * Starting PC/SC Daemon ...
 * start-stop-daemon: user `pcscd' not found
 * Failed to start PC/SC Daemon                                                                                               [ !! ]
 * ERROR: pcsclite failed to start
seems that it is needed to install the user pcscd?

Oh, come on, if you don't know about 'adduser' then why are you even running a rolling-release distro?
Title: Re: PGP-Smartcard with OpenRC
Post by: Phoen7x on 29 January 2019, 14:00:13
so we are doing support for parabola here?
I mean seriously, we are really thin in manpower...
I'm really disappointed. :(
Where is the difference if I install Artixlinux and remove all non-free components manually, or this work takes over the parabola-script (https://git.parabola.nu/blacklist.git)?
I had mistakenly assumed this forum would exist to help other people.
All the tips I have from this forum I could apply 1:1 on Parabola.

Oh, come on, if you don't know about 'adduser' then why are you even running a rolling-release distro?
Because I love the 'arch-way'.
There is no master yet fallen from the sky.
I know that I add the new group with:
Code: [Select]
# groupadd pcscd
and I know that a new user was created with:
Code: [Select]
# useradd pcscd
But I don't know which parameters are needed because this is no user to login.

Anyway,
with that
Code: [Select]
 * /run/pcscd: creating directory
 * /run/pcscd: correcting owner
 * Starting PC/SC Daemon ...                                                                                          [ ok ]
But my smartcard would not detected:
Code: [Select]
$ gpg2 --card-status
gpg: selecting openpgp failed: No suitable device found
gpg: OpenPGP Card does not exist: No suitable device found
With Arch+systemd and the same yubikey this worked.
Title: Re: PGP-Smartcard with OpenRC
Post by: artoo on 29 January 2019, 15:05:09


No need to be, you are on the artixlinux forum, not on parabola forum.
We only do support for artix.
It is fine you use openrc or runit, but since you are on parabola, you should ask for support on parabola forums.
It is really that simple, no support on this forum for other distros.
Title: Re: PGP-Smartcard with OpenRC
Post by: Phoen7x on 29 January 2019, 16:51:08
There is no parabola forum, that's why I'm here!
Title: Re: PGP-Smartcard with OpenRC
Post by: artoo on 29 January 2019, 17:37:21
There is no parabola forum, that's why I'm here!

Frankly, this is not an artix problem, you made a decision to use parabola.
We are only few people, and you don't seriously expect us to support another distro you have trouble with?