On 7/29/06, Bo Ørsted Andresen <[EMAIL PROTECTED]> wrote:
On Sunday 23 July 2006 13:18, Mick wrote:
> I checked the script I have in my /etc/X11/Sessions/fluxbox:
> ==============================
> eval "$(gpg-agent --daemon)"
> /usr/bin/startfluxbox
> kill `echo ${GPG_AGENT_INFO} | cut -d ':' -f 2`
> ==============================
>
> Running these separately after I kill gpg-agent *and* empty the /tmp/gpg-*
> entities gives me the following semi-illuminating response:
>
> $ eval "$(gpg-agent --daemon)"
> can't connect to `/home/michael/.gnupg/log-socket': Connection refused
>
> Why does this happen? A new ENV variable has been created alright in the
> /tmp dir:
>
> $ echo ${GPG_AGENT_INFO}
> /tmp/gpg-0UQfJ1/S.gpg-agent:11772:1
>
> I think that the kill `echo ${GPG_AGENT_INFO} | cut -d ':' -f 2` line in my
> fluxbox start up script kills the gpg-agent process but does not seem to
> flush the ENV variable, hence all this cruft accumulates in /tmp.
>
> Does anyone else have this problem?

Apparently gpg-agent does clean up properly after it when it is killed. I have
just changed my gpg-agent.sh shutdown script as shown below. The rm and rmdir
lines should make it clean up nicely after it.

$ cat ~/.kde/shutdown/gpg-agent.sh
#!/bin/sh
# the second field of the GPG_AGENT_INFO variable is the
# process ID of the gpg-agent active in the current session
# so we'll just kill that, rather than all of them :)
if [[ -n ${GPG_AGENT_INFO} ]]; then
        kill $(echo ${GPG_AGENT_INFO} | cut -d ':' -f 2)
        rm $(echo ${GPG_AGENT_INFO} | cut -d ':' -f 1)
        rmdir $(dirname `echo ${GPG_AGENT_INFO} | cut -d ':' -f 1`)
        unset GPG_AGENT_INFO
fi

--
Bo Andresen



First off, doesn't one of the boot scripts clean /tmp? Or is that just my 
imagination?
Second, I have found that it is better to mount /tmp as a tmpfs. That way I get 
a (slight) increase in performance when I'm ripping cd's and stuff, I don't 
risk running out of space on / (not all that big of a problem, though), 
whenever I turn the computer of /tmp get's cleared and, last but not least, I 
tell myself that I get more battery-time on my laptop since it doesmn't have to 
write to disk as much. Yay!
To do this, all you need is to put
none                    /tmp            tmpfs           defaults        0 0
in /etc/fstab. Add size=nbytes to select maximum size of the filesystem. 
Defaults to half of ram.


--
gentoo-user@gentoo.org mailing list

Reply via email to