1 |
On Sunday 23 July 2006 13:18, Mick wrote: |
2 |
> I checked the script I have in my /etc/X11/Sessions/fluxbox: |
3 |
> ============================== |
4 |
> eval "$(gpg-agent --daemon)" |
5 |
> /usr/bin/startfluxbox |
6 |
> kill `echo ${GPG_AGENT_INFO} | cut -d ':' -f 2` |
7 |
> ============================== |
8 |
> |
9 |
> Running these separately after I kill gpg-agent *and* empty the /tmp/gpg-* |
10 |
> entities gives me the following semi-illuminating response: |
11 |
> |
12 |
> $ eval "$(gpg-agent --daemon)" |
13 |
> can't connect to `/home/michael/.gnupg/log-socket': Connection refused |
14 |
> |
15 |
> Why does this happen? A new ENV variable has been created alright in the |
16 |
> /tmp dir: |
17 |
> |
18 |
> $ echo ${GPG_AGENT_INFO} |
19 |
> /tmp/gpg-0UQfJ1/S.gpg-agent:11772:1 |
20 |
> |
21 |
> I think that the kill `echo ${GPG_AGENT_INFO} | cut -d ':' -f 2` line in my |
22 |
> fluxbox start up script kills the gpg-agent process but does not seem to |
23 |
> flush the ENV variable, hence all this cruft accumulates in /tmp. |
24 |
> |
25 |
> Does anyone else have this problem? |
26 |
|
27 |
Apparently gpg-agent does clean up properly after it when it is killed. I have |
28 |
just changed my gpg-agent.sh shutdown script as shown below. The rm and rmdir |
29 |
lines should make it clean up nicely after it. |
30 |
|
31 |
$ cat ~/.kde/shutdown/gpg-agent.sh |
32 |
#!/bin/sh |
33 |
# the second field of the GPG_AGENT_INFO variable is the |
34 |
# process ID of the gpg-agent active in the current session |
35 |
# so we'll just kill that, rather than all of them :) |
36 |
if [[ -n ${GPG_AGENT_INFO} ]]; then |
37 |
kill $(echo ${GPG_AGENT_INFO} | cut -d ':' -f 2) |
38 |
rm $(echo ${GPG_AGENT_INFO} | cut -d ':' -f 1) |
39 |
rmdir $(dirname `echo ${GPG_AGENT_INFO} | cut -d ':' -f 1`) |
40 |
unset GPG_AGENT_INFO |
41 |
fi |
42 |
|
43 |
-- |
44 |
Bo Andresen |