From owner-freebsd-questions@FreeBSD.ORG Thu Mar 8 14:53:03 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 87BA416A402 for ; Thu, 8 Mar 2007 14:53:03 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from betty.computinginnovations.com (dsl081-227-250.chi1.dsl.speakeasy.net [64.81.227.250]) by mx1.freebsd.org (Postfix) with ESMTP id 0BA2813C4B2 for ; Thu, 8 Mar 2007 14:53:02 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from p28.computinginnovations.com (dhcp-10-20-30-100.computinginnovations.com [10.20.30.100]) (authenticated bits=0) by betty.computinginnovations.com (8.13.8/8.12.11) with ESMTP id l28EqSrx009579; Thu, 8 Mar 2007 08:52:28 -0600 (CST) Message-Id: <6.0.0.22.2.20070308084942.0247a948@mail.computinginnovations.com> X-Sender: derek@mail.computinginnovations.com X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Thu, 08 Mar 2007 08:52:20 -0600 To: freebsd-questions@freebsd.org, freebsd-questions@freebsd.org From: Derek Ragona In-Reply-To: <20070308085511.1ECA.GERARD@seibercom.net> References: <20070308085511.1ECA.GERARD@seibercom.net> Mime-Version: 1.0 X-ComputingInnovations-MailScanner-Information: Please contact the ISP for more information X-ComputingInnovations-MailScanner: Found to be clean X-ComputingInnovations-MailScanner-From: derek@computinginnovations.com X-Spam-Status: No Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Running script from rc.d as local user X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2007 14:53:03 -0000 You need a first line in your script to choose what shell to run it: #!/usr/local/bin/bash You should add a line: /usr/bin/su [to your username] Then try it at bootup as an rc script. -Derek At 08:24 AM 3/8/2007, Gerard Seibert wrote: >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=`tty` >export GPG_TTY > ># >## Start Agent >## >if test -f $HOME/.gpg-agent-info \ >&& kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then > GPG_AGENT_INFO=`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 >.bash_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. > >-- >Gerard > >_______________________________________________ >freebsd-questions@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-questions >To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > >-- >This message has been scanned for viruses and >dangerous content by MailScanner, and is >believed to be clean. >MailScanner thanks transtec Computers for their support. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support.