Gentoo Archives: gentoo-user

From: "farfargoth@×××××.com" <farfargoth@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Is this cruft in my /tmp?
Date: Sat, 29 Jul 2006 21:57:25
Message-Id: 5e5428ed0607291453q5afb1f0bxafd6c6a24008d700@mail.gmail.com
In Reply to: Re: [gentoo-user] Is this cruft in my /tmp? by "Bo Ørsted Andresen"
1 On 7/29/06, Bo Ørsted Andresen <bo.andresen@××××.dk> wrote:
2 > On Sunday 23 July 2006 13:18, Mick wrote:
3 > > I checked the script I have in my /etc/X11/Sessions/fluxbox:
4 > > ==============================
5 > > eval "$(gpg-agent --daemon)"
6 > > /usr/bin/startfluxbox
7 > > kill `echo ${GPG_AGENT_INFO} | cut -d ':' -f 2`
8 > > ==============================
9 > >
10 > > Running these separately after I kill gpg-agent *and* empty the /tmp/gpg-*
11 > > entities gives me the following semi-illuminating response:
12 > >
13 > > $ eval "$(gpg-agent --daemon)"
14 > > can't connect to `/home/michael/.gnupg/log-socket': Connection refused
15 > >
16 > > Why does this happen? A new ENV variable has been created alright in the
17 > > /tmp dir:
18 > >
19 > > $ echo ${GPG_AGENT_INFO}
20 > > /tmp/gpg-0UQfJ1/S.gpg-agent:11772:1
21 > >
22 > > I think that the kill `echo ${GPG_AGENT_INFO} | cut -d ':' -f 2` line in my
23 > > fluxbox start up script kills the gpg-agent process but does not seem to
24 > > flush the ENV variable, hence all this cruft accumulates in /tmp.
25 > >
26 > > Does anyone else have this problem?
27 >
28 > Apparently gpg-agent does clean up properly after it when it is killed. I have
29 > just changed my gpg-agent.sh shutdown script as shown below. The rm and rmdir
30 > lines should make it clean up nicely after it.
31 >
32 > $ cat ~/.kde/shutdown/gpg-agent.sh
33 > #!/bin/sh
34 > # the second field of the GPG_AGENT_INFO variable is the
35 > # process ID of the gpg-agent active in the current session
36 > # so we'll just kill that, rather than all of them :)
37 > if [[ -n ${GPG_AGENT_INFO} ]]; then
38 > kill $(echo ${GPG_AGENT_INFO} | cut -d ':' -f 2)
39 > rm $(echo ${GPG_AGENT_INFO} | cut -d ':' -f 1)
40 > rmdir $(dirname `echo ${GPG_AGENT_INFO} | cut -d ':' -f 1`)
41 > unset GPG_AGENT_INFO
42 > fi
43 >
44 > --
45 > Bo Andresen
46 >
47 >
48
49 First off, doesn't one of the boot scripts clean /tmp? Or is that just my imagination?
50 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!
51 To do this, all you need is to put
52 none /tmp tmpfs defaults 0 0
53 in /etc/fstab. Add size=nbytes to select maximum size of the filesystem. Defaults to half of ram.
54
55
56 --
57 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Is this cruft in my /tmp? Neil Bothwick <neil@××××××××××.uk>