# keychain, gpg-agent, pinentry, and the console

## cj

Using

```

net-misc/keychain-2.5.5

app-crypt/gnupg-1.4.2-r3

app-crypt/gpg-agent-1.9.19

app-crypt/pinentry-0.7.2-r1

```

with

```

keychain --agents ssh,gpg id_dsa 5B76CADC

[ -z "$HOSTNAME" ] && HOSTNAME=`uname -n`

[ -f $HOME/.keychain/$HOSTNAME-sh ] && \

       . $HOME/.keychain/$HOSTNAME-sh

[ -f $HOME/.keychain/$HOSTNAME-sh-gpg ] && \

       . $HOME/.keychain/$HOSTNAME-sh-gpg

```

in my .bash_profile (where 5B76CADC is the ID of my GPG key),

```

pinentry-program /usr/bin/pinentry

no-grab

default-cache-ttl 28800

```

in my .gnupg/gpg-agent.conf, and (of note)

```
use-agent
```

in my .gnupg/gpg.conf, keychain always gives me an

```

* Error: Problem adding (is pinentry installed?); giving up

```

error message when logging in on the console, after which I must reset the tty to bring it back to a usable state. I can then run, e.g.,

```

eval $(gpg-agent --daemon)

gpg --use-agent --sign test-file1

gpg --use-agent --sign test-file2

```

manually, which works as expected -- as long as I work in the same tty, I only have to enter the password of my GPG private key once (on the first invocation of gpg). I've tried various combinations of different versions of the involved packages and different settings for their USE flags, but none of them seems to improve the matter.

Anyone else has the same problem?

In case it's of any use, here's the output from emerge --info:

```

Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14.2-2005-11-22 i686)

=================================================================

System uname: 2.6.14.2-2005-11-22 i686 Intel(R) Pentium(R) M processor 1.60GHz

Gentoo Base System version 1.6.13

ccache version 2.3 [enabled]

dev-lang/python:     2.3.5, 2.4.2

sys-apps/sandbox:    1.2.12

sys-devel/autoconf:  2.13, 2.59-r6

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1

sys-devel/binutils:  2.15.92.0.2-r10

sys-devel/libtool:   1.5.20

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i386-pc-linux-gnu"

CFLAGS="-O2 -march=pentium-m -pipe"

CHOST="i386-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -march=pentium-m -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig ccache distlocks sandbox sfperms strict"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"

LANG="da_DK"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

USE="x86 X a52 aac alsa apm audiofile avi berkdb bitmap-fonts bzip2 cdr crypt cscope cups dvd eds emboss expat fbcon ffmpeg flac foomaticdb fortran gdbm gif gpm gstreamer gtk gtk2 imlib javascript jpeg lcms libg++ libwww lua mad mbox mikmod mmx mng motif mp3 mpeg ncurses nls nptl ogg oggvorbis opengl oss pam pcre pdflib perl png python qt quicktime readline slang speex spell sse ssl tcpd theora tiff truetype truetype-fonts type1-fonts udev vcd vorbis win32codecs xine xml2 xmms xv xvid zlib video_cards_radeon userland_GNU kernel_linux elibc_glibc"

Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS

```

----------

## plate

Curious whether you've got this out of the way because I've just run into the exact same problem. pinentry actually starts up with the same window as always, but only for a split second: then it dies, and I get the same message from keychain you got. I've remerged everything including the kitchen sink (ksba, assuan, gpgme, gnupg, pinentry, keychain) so everything should really be in mint condition, except that it isn't...   :Confused: 

----------

