# Mongrel PID file permissions

**URL:** <https://www.ruby-forum.com/t/mongrel-pid-file-permissions/116469>\
**Category:** Mongrel\
**Created:** [October 5, 2007, 8:42pm UTC](https://www.ruby-forum.com/t/mongrel-pid-file-permissions/116469 "2007-10-05T20:42:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fbeausoleil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ec9cab/32.png) [@fbeausoleil](https://www.ruby-forum.com/u/fbeausoleil)\
**Post date:** [October 5, 2007, 8:42pm UTC](https://www.ruby-forum.com/t/mongrel-pid-file-permissions/116469/1 "2007-10-05T20:42:04Z")

</div>

Hi !

I’m using Mongrel 1.0.1 with --pid and --user/–group. The PID files  
are correctly owned by the user/group, but their permissions is 0666.  
Is that normal ? Shouldn’t it be something like 0664 ?

Just curious to know if I’m wrong.

Configurator has this (line 77):

```
# Writes the PID file but only if we're on windows.
def write_pid_file
  if RUBY_PLATFORM !~ /mswin/
    log "Writing PID file to #{@pid_file}"
    open(@pid_file,"w") {|f| f.write(Process.pid) }
  end
end

```

The comment’s wrong, and we probably need a File.chmod call there  
somewhere. Should I submit a patch ?

## Thanks !

FranÃ§ois Beausoleil  
[http://blog.teksol.info/](http://blog.teksol.info/)  
[http://piston.rubyforge.org/](http://piston.rubyforge.org/)

---

<div class="post-metadata">

**Author:** ![fbeausoleil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ec9cab/32.png) [@fbeausoleil](https://www.ruby-forum.com/u/fbeausoleil)\
**Post date:** [October 6, 2007, 3:40am UTC](https://www.ruby-forum.com/t/mongrel-pid-file-permissions/116469/2 "2007-10-06T03:40:20Z")

</div>

On 10/5/07, FranÃ§ois Beausoleil [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> # Writes the PID file but only if we’re on windows.
> 
> def write\_pid\_file  
> if RUBY\_PLATFORM !~ /mswin/  
> log “Writing PID file to #{@pid\_file}”  
> open(@pid\_file,“w”) {|f| f.write(Process.pid) }  
> end  
> end
> 
> The comment’s wrong, and we probably need a File.chmod call there  
> somewhere. Should I submit a patch ?

Yes please!

I don’t see any reference to the file permission for the file, so  
maybe you require File.chmod after writting to it.

Post it to RubyForge tracker (under patches) and someone will check  
and test it before commiting.

Again, thank you for your time.

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![fbeausoleil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ec9cab/32.png) [@fbeausoleil](https://www.ruby-forum.com/u/fbeausoleil)\
**Post date:** [October 11, 2007, 7:54pm UTC](https://www.ruby-forum.com/t/mongrel-pid-file-permissions/116469/3 "2007-10-11T19:54:53Z")

</div>

Hi !

2007/10/5, Luis L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I don’t see any reference to the file permission for the file, so  
> maybe you require File.chmod after writting to it.
> 
> Post it to RubyForge tracker (under patches) and someone will check  
> and test it before commiting.

Take the patch from here:

[http://rubyforge.org/tracker/index.php?func=detail&aid=14641&group\_id=1306&atid=5147](http://rubyforge.org/tracker/index.php?func=detail&aid=14641&group_id=1306&atid=5147)

Bye !  
FranÃ§ois
