Moving the agent's socket to /var/run ?

Andreas Metzler ametzler at
Tue Feb 23 19:50:10 CET 2016

Werner Koch <wk at> wrote:
> GnuPG 2.x makes extensive use of Unix domain sockets for interprocess
> communication.  For example gpg-agent is listenening for requests from
> gpg or gpgsm on the socket ~/.gnupg/S.gpg-agent .  We have received a
> couple of reports from folks who have to install GnuPG in GnuPG home
> directory with a long file name.  This does not work well with sockets
> which usually have a limit on the length of their name.  The workaround
> What about changing the _default_ name for the sockets from, say,
> ~/.gnupg/S.gpg-agent to /var/run/user/<uid>/S.gpg-agent ?  This is
> similar to what system daemons use for their socket names and has the
> further advantage that /var/run is always locally mounted and would thus
> avoid the re-direction file hack used for NFS etc.  This would only be
> done if GNUPGHOME/--homedir is not set so that it is still possible to
> run a second instance of gnupg.


/var/run typically is a symlink to /run. Are per-user
subdirectories of /run common practise on other ditributions nowadays?
(I only know that Debian does not have them.) Having a default that
would not work for most of the users is probably not desirable.

You could use (a subdirectory of) /tmp.

cu Andreas
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

More information about the Gnupg-devel mailing list