mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-09 12:54:23 +01:00
Modernized gpg-agent startup instructions
This commit is contained in:
parent
596a2237c7
commit
f548ca97ad
@ -86,7 +86,7 @@ w32_shgetfolderpath (HWND a, int b, HANDLE c, DWORD d, LPSTR e)
|
|||||||
|
|
||||||
/* Get the standard home directory. In general this function should
|
/* Get the standard home directory. In general this function should
|
||||||
not be used as it does not consider a registry value (under W32) or
|
not be used as it does not consider a registry value (under W32) or
|
||||||
the GNUPGHOME encironment variable. It is better to use
|
the GNUPGHOME environment variable. It is better to use
|
||||||
default_homedir(). */
|
default_homedir(). */
|
||||||
const char *
|
const char *
|
||||||
standard_homedir (void)
|
standard_homedir (void)
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2009-03-02 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* gpg-agent.texi (Invoking GPG-AGENT): Modernized instructions.
|
||||||
|
|
||||||
2009-01-12 Werner Koch <wk@g10code.com>
|
2009-01-12 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* faq.raw: Fix bug reorting address.
|
* faq.raw: Fix bug reorting address.
|
||||||
|
@ -61,22 +61,35 @@ to run multiple instance of the @command{gpg-agent}, so you should make
|
|||||||
sure that only one is running: @command{gpg-agent} uses an environment
|
sure that only one is running: @command{gpg-agent} uses an environment
|
||||||
variable to inform clients about the communication parameters. You can
|
variable to inform clients about the communication parameters. You can
|
||||||
write the content of this environment variable to a file so that you can
|
write the content of this environment variable to a file so that you can
|
||||||
test for a running agent. This short script may do the job:
|
test for a running agent. Here is an example using Bourne shell synax:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
if test -f $HOME/.gpg-agent-info && \
|
gpg-agent --daemon --enable-ssh-support \
|
||||||
kill -0 $(cut -d: -f 2 $HOME/.gpg-agent-info) 2>/dev/null; then
|
--write-env-file "$@{HOME@}/.gpg-agent-info"
|
||||||
GPG_AGENT_INFO=$(cat $HOME/.gpg-agent-info)
|
@end smallexample
|
||||||
export GPG_AGENT_INFO
|
|
||||||
else
|
This code should only be run once per user session to initially fire up
|
||||||
eval $(gpg-agent --daemon)
|
the agent. In the example the optional support for the included Secure
|
||||||
echo $GPG_AGENT_INFO >$HOME/.gpg-agent-info
|
Shell agent is enabled and the information about the agent is written to
|
||||||
|
a file in the HOME directory. Note that by running gpg-agent without
|
||||||
|
arguments you may test whether an agent is already running; however such
|
||||||
|
a test may lead to a race condition, thus it is not suggested.
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
The second script needs to be run for each interactive session:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
if [ -f "$@{HOME@}/.gpg-agent-info" ]; then
|
||||||
|
. "$@{HOME@}/.gpg-agent-info"
|
||||||
|
export GPG_AGENT_INFO
|
||||||
|
export SSH_AUTH_SOCK
|
||||||
|
export SSH_AGENT_PID
|
||||||
fi
|
fi
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
Note that the new option @option{--write-env-file} may be used instead.
|
It reads the data out of the file and exports the variables. If you
|
||||||
|
don't use Secure Shell, you don't need the last two export statements.
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
You should always add the following lines to your @code{.bashrc} or
|
You should always add the following lines to your @code{.bashrc} or
|
||||||
|
Loading…
x
Reference in New Issue
Block a user