Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Mar 2007 09:24:47 -0500
From:      Gerard Seibert <gerard@seibercom.net>
To:        freebsd-questions@freebsd.org
Subject:   Running script from rc.d as local user
Message-ID:  <20070308085511.1ECA.GERARD@seibercom.net>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070308085511.1ECA.GERARD>