From owner-freebsd-stable@FreeBSD.ORG Fri Jul 15 22:59:03 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C0F01065672; Fri, 15 Jul 2011 22:59:03 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id C76488FC0C; Fri, 15 Jul 2011 22:59:02 +0000 (UTC) Received: by iyb11 with SMTP id 11so1919968iyb.13 for ; Fri, 15 Jul 2011 15:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=SIKgARql85XXrXyKgd4UoRByjtMaIBRWXeA+vCF6Ifg=; b=GyPT4pLUEALfTic5n+2+CncI1iMV0RD6341BM1p7jcgP2iXEIfowxvEHL6qv4nD/hq Ww27Mmg46+hDrinzaDdPQH+Bu5WD2YSev5slxNyHVnrx8ZXcCzh3VOp5yWf6xRXcK7qq mhjdEkTy7LpTZlJ7ts8a6au0WZ28i3dG5X9rw= Received: by 10.42.28.10 with SMTP id l10mr4697383icc.299.1310770739248; Fri, 15 Jul 2011 15:58:59 -0700 (PDT) Received: from DataIX.net ([99.181.137.22]) by mx.google.com with ESMTPS id k16sm1847012icc.10.2011.07.15.15.58.56 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jul 2011 15:58:57 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p6FMwsq6046101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Jul 2011 18:58:54 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p6FMwrrh046100; Fri, 15 Jul 2011 18:58:53 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Fri, 15 Jul 2011 18:58:53 -0400 From: Jason Hellenthal To: Doug Barton Message-ID: <20110715225853.GC24288@DataIX.net> References: <4E1E8FE0.7040305@snafu.de> <4E1EA170.4080708@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E1EA170.4080708@FreeBSD.org> Cc: FreeBSD_mailiglist_KERNEL , joerg_surmann Subject: Re: gpg-agent dont start automatically X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2011 22:59:03 -0000 On Thu, Jul 14, 2011 at 12:57:36AM -0700, Doug Barton wrote: > On 07/13/2011 23:42, joerg_surmann wrote: > > > > Hi all, > > > > i have in my .xinitrc: > > exec /usr/local/bin/gpg-agent --daemon --write-env-file > > .gnupg/agent.info /usr/home/holm/.gpg-agent-info > > > > Thats don't start gpg-agent. > > Take a look at this: > > http://dougbarton.us/PGP/gpg-agent.html > This may be helpful too for reference there are a lot of ways you can go about setting this up. Here is mine. ======================================================================= using cron @reboot & every 5 minutes: #!/bin/sh # Start gpg-agent if it is not running as the current user. umask 077 rm -f $HOME/.gpg-agent-info # only for @reboot. remove for minutely pgrep -q -U $LOGNAME gpg-agent ||/usr/local/bin/gpg-agent --daemon --write-env-file "${HOME}/.gpg-agent-info" >>/dev/null 2>&1 ======================================================================== Then in your profile or rc file for the shell: (bourne compatible) GPG_TTY="$(tty)" if [ -n "$(pgrep -U $LOGNAME gpg-agent)" -a -f ${HOME}/.gpg-agent-info ]; then . ${HOME}/.gpg-agent-info export GPG_AGENT_INFO if [ -S ${HOME}/.gnupg/S.gpg-agent.ssh ]; then export SSH_AUTH_SOCK fi echo "GNU Privacy Guard Agent [ENABLED]" echo else unset GPG_AGENT_INFO if [ -f ${HOME}/.gpg-agent-info ]; then rm -f ${HOME}/.gpg-agent-info fi fi ======================================================================== Adjust appropriately for your environment. This should allow you to use gpg-agent form the console, any xterm, rxvt etc... and any X applications while X is running and ensure that gpg-agent is restarted if it for some reason fails. Good luck.