Re: debugging systemd user services for gpg-agent and dirmngr [was: Re: gpg hangs when asking for passphrase]

2017-05-15 Thread Joey Morris
Daniel Kahn Gillmor  wrote on Wed, May 10, 2017 at 
10:58:21PM -0400:
> On Wed 2017-05-10 22:17:28 -0400, Joey Morris wrote:
> > I have systemd version 222-1 installed, which appears to be wildly out of 
> > date.
> > The first thing I'll try when I get back to this is to upgrade systemd.
> 
> yes, please!

After upgrading systemd, I'm happy to report that my agent connections no longer
hang and everything seems to be working well. (Because the upgrade fixed my
problem, I didn't attempt your other suggestion of moving my .xsession startup
tasks to .config/openbox/autostart.) Thank you for the assistance!

Joey


___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: debugging systemd user services for gpg-agent and dirmngr [was: Re: gpg hangs when asking for passphrase]

2017-05-10 Thread Joey Morris
Daniel Kahn Gillmor  wrote on Wed, May 10, 2017 at 
02:10:27PM -0400:
> One difference i note is that you're using ~/.xsession, and i'm just
> relying on the alternatives system to launch openbox:
> 
> 0 dkg@alice:~$ readlink -f $(which x-session-manager)
> /usr/bin/openbox-session
> 0 dkg@alice:~$ 
> 
> ( For the programs that i want launched per-graphical-session that can't
>   be handled as systemd user services, i include them in
>   ~/.config/openbox/autostart )

I've been using my .xession setup for a number of years, and actually when this
issue came up it was the first I'd heard of systemd user services. (I was aware
of the system-level systemd, just not the user-specific part.) I'll spend some
time getting up to speed on it.

> Do you think you could try that approach (with the systemd user services
> unmasked) and see whether the agents respond properly?  if so, it'd give
> us something specific to debug (we would look into your .xsession to try
> to figure out how it differs from the standard startup).

Sure, I'll give it a try. It will probably be a few days before I can spend more
time on this, though.

> also, when the systemd user services are unmasked, what is shown by:
> 
> journalctl --user-unit gpg-agent dirmngr

I get:

No journal files were found.
Failed to add match 'dirmngr': Invalid argument

Running just `journalctl --user-unit gpg-agent`, I get:

No journal files were found.
Failed to get journal fields: Cannot assign requested address

I have systemd version 222-1 installed, which appears to be wildly out of date.
The first thing I'll try when I get back to this is to upgrade systemd.

Thanks!
Joey


___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: gpg hangs when asking for passphrase

2017-05-09 Thread Joey Morris
Thanks for thinking about this, Daniel. Answers to your questions below.

Daniel Kahn Gillmor  wrote on Tue, May 09, 2017 at 
12:38:56PM -0400:
> are you using systemd?

Yes.

> do you have dbus-user-session installed?

I didn't at first, but I do now. I saw the hanging behavior both before and
after I installed it.

> how are you logged into the machine (e.g. X11 via gdm, wayland with gdm, a
> text-mode-only vt console, etc, ssh session only)?

X11 via startx. I run openbox-session at the end of .xsession.

> do you have libpam-systemd installed?

Yes. Version 222-1.

> are you logged into the machine in multiple concurrent sessions?

No.

> does "gpg-connect-agent" on its own hang, rather
> than giving you a "> " prompt that you can interact with?

Yes, gpg-connect-agent on its own hangs. (Because I had masked my systemd units
as a workaround, as mentioned in my other email, I unmasked them to reproduce
the hanging scenario in order to test this.)

> what version of the debian package are you running?

Originally 2.1.18-6, and then I upgraded to 2.1.18-7. Same behavior in both
cases.

> when you say you've tried several pinentry variants, how did you try them all?

For a couple of them, I edited ~/.gnupg/gpg-agent.conf. For the others, I put
the generic "pinentry-program /usr/bin/pinentry" in gpg-agent.conf and used
Debian's alternatives to specify the preferred variant. In each case, I re-ran
one of the hanging commands after making the change.

I also tried pinentry-gnome3 just now, because I noticed that it's specifically
mentioned in Debian's gnupg-agent README, but it still hangs.

Joey


___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: gpg hangs when asking for passphrase

2017-05-09 Thread Joey Morris
Peter Lebbing  wrote on Tue, May 09, 2017 at 
11:50:33AM +0200:
> Is it possible that this started occuring after upgrading the gnupg
> package? 2.1.17-4 (from 10 Jan) introduced using systemd user sessions
> for gpg-agent and dirmngr by default. When I had this enabled on Debian
> jessie, a connection to the agent would just hang. I figured this had to
> do with a difference in systemd between jessie and stretch/sid. But
> perhaps you're experiencing a variant of it. Do you have the package
> dbus-user-session installed?

Thanks Peter, I think this is indeed related to the systemd user sessions. Just
to clarify, did you solve your problem by disabling the systemd units, or did
you end up getting it working with them?

Checking my apt logs, I upgraded from gnupg-1.4.19-3 and gnupg2-2.0.28-3 to just
gnupg2-2.1.18-6 on March 18. (So it wasn't a new install of gnupg as I implied
originally.) March 18 is the day I installed pass and started using it, and by
extension, gpg, succesfully. I didn't install dbus-user-session. Then I rebooted
on May 7. My guess is that gpg-agent didn't start running through systemd until
I rebooted.

I installed dbus-user-session this morning, logged out and back in, and the
agent connection still hung. Then I masked the systemd user units per the Debian
README for gpg-agent, and now everything is working again.

I have a working setup now, which is my top priority, although I'm also
interested in figuring out why the default method isn't working. But perhaps
that's more of a question for Debian.

Joey


___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


gpg hangs when asking for passphrase

2017-05-08 Thread Joey Morris
I'm pretty new to GnuPG, having installed it a couple months ago for use with
the pass password manager. Everything was working fine until I rebooted my
computer yesterday, and now gpg hangs at the point where I believe it should ask
me for my key's passphrase. For example, the following command hangs:

  $ cat test.encrypted | gpg --decrypt

After several minutes I kill it with Ctrl-C.

I've tried several things without figuring out the problem:

  - Verified that gpg-agent is running with `pgrep -u "${USER}" gpg-agent`.
  - Restarted gpg-agent with `killall gpg-agent`.
  - Verified that the socket referenced by $GPG_AGENT_INFO exists.
  - Ran `export GPG_TTY=$(tty)` in my terminal.
  - Tried several pinentry variants (tty, curses, qt, gtk). Before rebooting,
I'd been using pinentry-tty without a problem.

A couple other examples of commands that hang:

  $ gpg-connect-agent reloadagent /bye
  $ gpg --edit-key userid

I'm running version 2.1.18 on debian sid. Does anyone have thoughts on what
might be happening or suggestions for additional troubleshooting?

Thanks.
Joey


___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users