Unix domain socket and /var/run or /tmp?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Unix domain socket and /var/run or /tmp?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Unix domain socket and /var/run or /tmp?  
skillzero@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-27-06 12:30 PM

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?






[ Post a follow-up to this message ]



    Re: Unix domain socket and /var/run or /tmp?  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:32 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register