From owner-freebsd-questions@FreeBSD.ORG Thu Mar 8 14:24:35 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B93616A403 for ; Thu, 8 Mar 2007 14:24:35 +0000 (UTC) (envelope-from gerard@seibercom.net) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.232]) by mx1.freebsd.org (Postfix) with ESMTP id 2014913C48D for ; Thu, 8 Mar 2007 14:24:34 +0000 (UTC) (envelope-from gerard@seibercom.net) Received: by wx-out-0506.google.com with SMTP id s18so465100wxc for ; Thu, 08 Mar 2007 06:24:34 -0800 (PST) Received: by 10.70.67.10 with SMTP id p10mr798424wxa.1173363874528; Thu, 08 Mar 2007 06:24:34 -0800 (PST) Received: from ?192.168.0.4? ( [67.189.184.224]) by mx.google.com with ESMTP id h14sm1809476wxd.2007.03.08.06.24.33; Thu, 08 Mar 2007 06:24:33 -0800 (PST) Date: Thu, 08 Mar 2007 09:24:47 -0500 From: Gerard Seibert To: freebsd-questions@freebsd.org Organization: Seibercom.NET X-Face: "\j?x](l|]4p?-1Bf@!wN<&p=$.}^k-HgL}cJKbQZ3r#Ar]\%U(#6}'?<3s7%(%(gxJxxcR nSNPNr*/^~StawWU9KDJ-CT0k$f#@t2^K&BS_f|?ZV/.7Q Message-Id: <20070308085511.1ECA.GERARD@seibercom.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Becky! ver. 2.30.03 [en] Subject: Running script from rc.d as local user X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2007 14:24:35 -0000 I am trying to get gpg-agent to start at boot time. If I place this in the ~/.bash_profile file, the program starts correctly. GPG_TTY=3D`tty` export GPG_TTY # ## Start Agent ##=20 if test -f $HOME/.gpg-agent-info \ && kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then GPG_AGENT_INFO=3D`cat $HOME/.gpg-agent-info` export GPG_AGENT_INFO else eval `gpg-agent --daemon` echo $GPG_AGENT_INFO >$HOME/.gpg-agent-info fi The problem is, if I log in again from a remote location, the =2Ebash_login is read again and another copy of gpg-agent is started. Obviously, I do not want that behavior. I tried starting it from CRON; however, the variables: GPG_AGENT_INFO GPG_TTY are not set.. I then tried to create a script and run it from /usr/local/etc/rc.d; however, that forces the script to run as root, which I do not want. --=20 Gerard