First recommend to use the saint
]$ man gpg-agent
Read it.
You will learn that gpg-agent should be started rather as daemon and only as a single pid. If you start looking the daemon start-up procedure inside your system of course, you won't find it (I didn't and it was Fedora 10). Well, First what I decided to do was to fallow the manual, so I did:
Code:
]$ vi $HOME/.bashrc
and added following lines into it:
Code:
# GPG-AGENT stuff
GET_TTY=`tty`
export $GET_TTY
$HOME/<somercdir>/gpg-agent-start.sh
Yes, you don't have the "gpg-agent-start.sh" file yet and there is no word about it in man! Here it is:
Code:
#!/bin/bash
# Decide wether to start gpg-agent daemon.
# Create necessary symbolic link in $HOME/.gnupg/S.gpg-agent
SOCKET=S.gpg-agent
PIDOF=`pidof gpg-agent`
RETVAL=$?
if [ "$RETVAL" -eq 1 ]; then
echo "Starting gpg-agent daemon."
eval `gpg-agent --daemon `
else
echo "Daemon gpg-agent already running."
fi
# Nasty way to find gpg-agent's socket file...
GPG_SOCKET_FILE=`find /tmp/gpg-* -name $SOCKET`
echo "Updating socket file link."
cp -fs $GPG_SOCKET_FILE $HOME/.gnupg/S.gpg-agent
I'm not quite sure if there is a better way to quickly, find a place of a socket file. In my system it is placed randomly in /tmp/gpg-xxxxxxx/S.gpg-agent, where xxxxxxx are random characters.
If anyone know it please write it down...
Regards...