09-27-06 06:21 PM
In article <1159346051.630193.24030@i42g2000cwa.googlegroups.com>,
"skillzero@gmail.com" <skillzero@gmail.com> wrote:
> Is there a good reason to bind a Unix domain socket to /var/run/xyz
> instead /tmp/xyz? I've always used /tmp in the past because it avoided
> issues with /var/run not always being there or not being writable (and
> Steven's examples seem to use /tmp), but I notice a lot of things use
> /var/run.
>
> Are there advantages to /var/run over /tmp?
/var/run is likely to be writable only by the superuser, so any
recommendation to use it is probably directed specifically at system
daemons, not ordinary user applications.
And in this case, you avoid possible race conditions that could occur if
an ordinary user creates a socket in /tmp with the same name the daemon
was going to use.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
[ Post a follow-up to this message ]
|