donnie at darthik.com
2007-Feb-21 03:19 UTC
[Mongrel] Mongrel_Cluster PID File Creation Error.
Hello, Thank you for your development of Mongrel, great job. :) I am using mongrel_cluster, but I have a problem where my rails application name includes a "." such as mydomain.com, which causes an error when generating the PID file for mongrel. I have attached below a diff of the current working copy in the trunk and the changes I made to overcome this problem. I kept your convention of assuming the file ends with ".pid" in my changes. Hope this helps. __ Donnie Jones svn diff Index: init.rb ==================================================================--- init.rb (revision 519) +++ init.rb (working copy) @@ -24,7 +24,7 @@ } conf = YAML.load_file(@config_file) @options.merge! conf if conf - @pid_file = @options["pid_file"].split(".") + @pid_file = @options["pid_file"].split(".pid") start_port = end_port = @only start_port ||= @options["port"].to_i @@ -34,7 +34,7 @@ end def port_pid_file(port) - "#{@pid_file[0]}.#{port}.#{@pid_file[1]}" + "#{@pid_file}.#{port}.pid" end def start
Hi Donnie: Thanks for raising this issue and the patch. Locally, I''ve patched it using ruby''s File.basename and it seems to work for your use case and supports other file extensions. I''m working on another prerelease now. Regards, Bradley Taylor donnie at darthik.com wrote:> Hello, > > Thank you for your development of Mongrel, great job. :) > > I am using mongrel_cluster, but I have a problem where my rails > application name includes a "." such as mydomain.com, which causes an > error when generating the PID file for mongrel. > > I have attached below a diff of the current working copy in the trunk > and the changes I made to overcome this problem. I kept your convention > of assuming the file ends with ".pid" in my changes. > > Hope this helps. > __ > Donnie Jones > > > > svn diff > Index: init.rb > ==================================================================> --- init.rb (revision 519) > +++ init.rb (working copy) > @@ -24,7 +24,7 @@ > } > conf = YAML.load_file(@config_file) > @options.merge! conf if conf > - @pid_file = @options["pid_file"].split(".") > + @pid_file = @options["pid_file"].split(".pid") > > start_port = end_port = @only > start_port ||= @options["port"].to_i > @@ -34,7 +34,7 @@ > end > > def port_pid_file(port) > - "#{@pid_file[0]}.#{port}.#{@pid_file[1]}" > + "#{@pid_file}.#{port}.pid" > end > > def start > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users
donnie at darthik.com
2007-Feb-21 20:04 UTC
[Mongrel] Mongrel_Cluster PID File Creation Error.
Hello Bradley, Excellent, glad I was of some assistance. :) It does look like File.basename would be more consistent and less error-prone. __ Donnie Bradley Taylor wrote:> Hi Donnie: > > Thanks for raising this issue and the patch. Locally, I''ve patched it > using ruby''s File.basename and it seems to work for your use case and > supports other file extensions. > > I''m working on another prerelease now. > > Regards, > Bradley Taylor > > donnie at darthik.com wrote: > >> Hello, >> >> Thank you for your development of Mongrel, great job. :) >> >> I am using mongrel_cluster, but I have a problem where my rails >> application name includes a "." such as mydomain.com, which causes an >> error when generating the PID file for mongrel. >> >> I have attached below a diff of the current working copy in the trunk >> and the changes I made to overcome this problem. I kept your convention >> of assuming the file ends with ".pid" in my changes. >> >> Hope this helps. >> __ >> Donnie Jones >> >> >> >> svn diff >> Index: init.rb >> ==================================================================>> --- init.rb (revision 519) >> +++ init.rb (working copy) >> @@ -24,7 +24,7 @@ >> } >> conf = YAML.load_file(@config_file) >> @options.merge! conf if conf >> - @pid_file = @options["pid_file"].split(".") >> + @pid_file = @options["pid_file"].split(".pid") >> >> start_port = end_port = @only >> start_port ||= @options["port"].to_i >> @@ -34,7 +34,7 @@ >> end >> >> def port_pid_file(port) >> - "#{@pid_file[0]}.#{port}.#{@pid_file[1]}" >> + "#{@pid_file}.#{port}.pid" >> end >> >> def start >> >> >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users >> > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >
On Tue, 20 Feb 2007 22:19:34 -0500 "donnie at darthik.com" <donnie at darthik.com> wrote:> Hello, > > Thank you for your development of Mongrel, great job. :) > > I am using mongrel_cluster, but I have a problem where my rails > application name includes a "." such as mydomain.com, which causes an > error when generating the PID file for mongrel.Hey Donnie, did you try the latest mongrel_cluster to see if this was fixed? I believe Bradley fixed it but please double check. thx -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/
Seemingly Similar Threads
- problem restarting mongrel_cluster outside RAILS_ROOT - patch and other option
- mongrel_cluster 1.0.1.1 does not create /var/run/mongrel_cluster
- Mongrel Cluster 1.0.1.1 Prerelease: Healing power of the pack!
- Rails db model validation with separate web forms, help.
- Why not ignore stale PID files?