Running script from rc.d as local user
gerard at seibercom.net
Thu Mar 8 14:24:35 UTC 2007
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.
## Start Agent
if test -f $HOME/.gpg-agent-info \
&& kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then
eval `gpg-agent --daemon`
echo $GPG_AGENT_INFO >$HOME/.gpg-agent-info
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:
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.
More information about the freebsd-questions