Zed Shaw
2006-May-20 20:30 UTC
[Rails] [ANN] Mongrel 0.3.13 Update -- Code Review, Code Coverage
Hey Folks, I''ve been holding off the official 0.3.13 release so that Luis can get the win32 side very nice and clean. We fixed a major problem last night so it''s only a short time before we get it out. Luis is working really hard on it, so just be patient. In the meantime, I''ve been doing a code audit of the Mongrel code as it is now and fixing any little things I come across. I''ve just updated the pre-release gems for 0.3.13 with the following fixes: * Cleaned up the new HTTP IO loop a bit so that it''s even more accurate. Still haven''t been able to replicate my earlier SEGFAULT errors, which is why I''m doing a code audit. * Removed various unneeded errors and files. * Removed resolv-replace since it seems it only works reliably on Linux. If you find that DNS resolving takes forever and stops your ruby program then consider require ''resolv-replace'' somewhere as a fix. * Moved a bunch of crap around so that Wilson''s broke ass win32 setup would work. :-) * The MIME types that you set from a YAML file actually weren''t being set. Now they are. I''m an idiot. * Austin Godber wrote up some nice instructions for using pound. http://mongrel.rubyforge.org/docs/pound.html * A code review of lib/mongrel.rb and lib/mongrel/rails.rb fixing up some minor things. * Initial changes to let people specify which type of -B output they want, just in case they only want thread logging or something. * Fixed a format string error that was causing problems when people closed the socket on send_file. * Fixes for win32 so that CTRL-C works, it handles SIGINT properly, and the shutdown is more graceful. This should also fix similar problems with people who run a ruby that has pthreads. * Small fixes to test files so that they can be run independently as reported by Rui Lopes. Additionally, I''m using rcov to get a coverage report. Everyone can check it out at http://mongrel.rubyforge.org/coverage/ as I write more tests. I''m hoping to get the test coverage closer to 100%, but that''s pretty difficult since some of the code requires actually having a running Rails application. DOCUMENTATION VOLUNTEERS We''re looking for folks who are interested in helping write Mongrel documentation. Writing the documentation is pretty easy, since it''s done with webgen and using textile. If anyone''s interested, take a look at: http://mongrel.rubyforge.org/docs/ And pick one of the empty pages. I''m currently working on the Apache documentation, but anyone who wants to volunteer can just e-mail me and I''ll hook you up with instructions. All authors get credit for writing their documentation and can link to their blogs. Thanks, and please report the bugs. -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/
Wilson Bilkovich
2006-May-20 20:37 UTC
[Mongrel] [ANN] Mongrel 0.3.13 Update -- Code Review, Code Coverage
On 5/20/06, Zed Shaw <zedshaw at zedshaw.com> wrote:> Hey Folks, > > * Moved a bunch of crap around so that Wilson''s broke ass win32 setup > would work. :-)That''s cold, man.. It''s not broke ass.. it''s finely tuned!
Zed Shaw
2006-May-20 23:22 UTC
[Rails] [ANN] Mongrel 0.3.13 Bugs Update -- Change UID/GID Patch
Just a quick announce telling people to update the pre-release again. Fixed and added the following goodies: * Bug where send_file wasn''t indicating that the body has been sent which caused problems in a few situations. * Bug where DirHandler wasn''t unescaping the URI paths. * Patch from Bradley Taylor that gives mongrel_rails start the options -u and -g. These will change the uid/gid on UNIX (not WIN32!) to the requested ones. Please test this out on various Unix flavors and report bugs. * Spelling corrections (hot damn gvim is the bomb). -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/
Luis Lavena
2006-May-21 00:53 UTC
[Mongrel] [ANN] Mongrel 0.3.13 Bugs Update -- Change UID/GID Patch
On 5/20/06, Zed Shaw <zedshaw at zedshaw.com> wrote:> * Patch from Bradley Taylor that gives mongrel_rails start the options > -u and -g. These will change the uid/gid on UNIX (not WIN32!) to the > requested ones.Man, hate we clash parameters, soon we will be using -$ -% and -* to set new options... Why better we don''t start leaving these new options to the config file and keep params to the minimum? -- Luis Lavena 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
Zed Shaw
2006-May-21 02:52 UTC
[Mongrel] [ANN] Mongrel 0.3.13 Bugs Update -- Change UID/GID Patch
On Sat, 2006-05-20 at 21:53 -0300, Luis Lavena wrote:> On 5/20/06, Zed Shaw <zedshaw at zedshaw.com> wrote: > > * Patch from Bradley Taylor that gives mongrel_rails start the options > > -u and -g. These will change the uid/gid on UNIX (not WIN32!) to the > > requested ones. > > Man, hate we clash parameters, soon we will be using -$ -% and -* to > set new options... > > Why better we don''t start leaving these new options to the config file > and keep params to the minimum? > >Damn, sorry about that man. We can change those easily though. I actually think I might change it to -M user:group since it doesn''t make a lot of sense to just change user. -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/
bradley taylor
2006-May-21 12:20 UTC
[Mongrel] [ANN] Mongrel 0.3.13 Bugs Update -- Change UID/GID Patch
On May 20, 2006, at 10:52 PM, Zed Shaw wrote:> On Sat, 2006-05-20 at 21:53 -0300, Luis Lavena wrote: >> On 5/20/06, Zed Shaw <zedshaw at zedshaw.com> wrote: >>> * Patch from Bradley Taylor that gives mongrel_rails start the >>> options >>> -u and -g. These will change the uid/gid on UNIX (not WIN32!) to >>> the >>> requested ones. >> >> Man, hate we clash parameters, soon we will be using -$ -% and -* to >> set new options... >> >> Why better we don''t start leaving these new options to the config >> file >> and keep params to the minimum?Since both mongrel_rails and mongrel_cluster support config file generation, we still need a way to specify what options to write to the config file.> > Damn, sorry about that man. We can change those easily though. I > actually think I might change it to -M user:group since it doesn''t > make > a lot of sense to just change user.I submitted a new patch that removes the short name options [-u,-g] and leaves the long names, --user and --group. I also added a check to Start::validate that requires that both user and group are specified together. This should address both concerns. The patch also switches the order of the calls to change_privilege by changing to the group then user. Thanks, Bradley ------ Rails Machine Simplified Ruby on Rails application deployment http://railsmachine.com
Luis Lavena
2006-May-21 12:30 UTC
[Mongrel] [ANN] Mongrel 0.3.13 Bugs Update -- Change UID/GID Patch
On 5/21/06, bradley taylor <bradley at railsmachine.com> wrote:> > On May 20, 2006, at 10:52 PM, Zed Shaw wrote: > > > On Sat, 2006-05-20 at 21:53 -0300, Luis Lavena wrote: > >> On 5/20/06, Zed Shaw <zedshaw at zedshaw.com> wrote: > >>> * Patch from Bradley Taylor that gives mongrel_rails start the > >>> options > >>> -u and -g. These will change the uid/gid on UNIX (not WIN32!) to > >>> the > >>> requested ones. > >> > >> Man, hate we clash parameters, soon we will be using -$ -% and -* to > >> set new options... > >> > >> Why better we don''t start leaving these new options to the config > >> file > >> and keep params to the minimum? > > Since both mongrel_rails and mongrel_cluster support config file > generation, we still need a way to specify what options to write to > the config file.My concern is that -u is user in win32 to set the processor affinity, and some user that follow win32->linux path will found issues with their declarations on how mongrel should be running. Also, I''ll be adding options for user context to the service stuff, what will allow run a mongrel service on accounts different than LocalService.> > Thanks, > Bradley >Its a excelent work Brad, and I think we should keep differences in params between platform to the minimun, so docs don''t get a lot of "this only works on posix" "this stuff don''t work on win32", "this is for my poor win32 machine" and so on. Regards, -- Luis Lavena 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
bradley taylor
2006-May-21 13:34 UTC
[Mongrel] [ANN] Mongrel 0.3.13 Bugs Update -- Change UID/GID Patch
On May 21, 2006, at 8:30 AM, Luis Lavena wrote:>>>> Why better we don''t start leaving these new options to the config >>>> file >>>> and keep params to the minimum? >> >> Since both mongrel_rails and mongrel_cluster support config file >> generation, we still need a way to specify what options to write to >> the config file. > > My concern is that -u is user in win32 to set the processor affinity, > and some user that follow win32->linux path will found issues with > their declarations on how mongrel should be running.I agree and that''s why I removed -u and -g. My point is that we still need to add options to support configuration file generation. However, I think we can prevent name clashes by only using long option names like --user and --group.> Also, I''ll be adding options for user context to the service stuff, > what will allow run a mongrel service on accounts different than > LocalService.You should be able to add --user/--group and not have any conflicts. The question is whether Process::GID and Process::UID are supported on Win32. The Ruby doc describes them as "a collection of module functions which can be used to portably get, set, and switch the current process?s real, effective, and saved group IDs." Although I don''t know if the "portably" part includes Win32. If not, it should be possible to add a platform check in Mongrel::Configurator::change_privilege that calls ImpersonateSecurityContext (or similar function) instead.> Its a excelent work Brad, and I think we should keep differences in > params between platform to the minimun, so docs don''t get a lot of > "this only works on posix" "this stuff don''t work on win32", "this is > for my poor win32 machine" and so on.Thanks. I agree. Regards, Bradley Taylor ------ Rails Machine Simplified Ruby on Rails application deployment http://railsmachine.com
Luis Lavena
2006-May-21 13:49 UTC
[Mongrel] [ANN] Mongrel 0.3.13 Bugs Update -- Change UID/GID Patch
On 5/21/06, bradley taylor <bradley at railsmachine.com> wrote: [snip]> > Also, I''ll be adding options for user context to the service stuff, > > what will allow run a mongrel service on accounts different than > > LocalService. > > You should be able to add --user/--group and not have any conflicts. > > The question is whether Process::GID and Process::UID are supported > on Win32. The Ruby doc describes them as "a collection of module > functions which can be used to portably get, set, and switch the > current process''s real, effective, and saved group IDs." Although I > don''t know if the "portably" part includes Win32. If not, it should > be possible to add a platform check in > Mongrel::Configurator::change_privilege that calls > ImpersonateSecurityContext (or similar function) instead.For running plain mongrel_rails isn''t possible, but instead when registering the service, so the service manager will do the impersonation for you when start the service. Also, I''ll like to address the dependencies of the service, so networking or other service get up before we try to bind a socket (this happens sometimes when you set your service to start automatically). Later, -- Luis Lavena 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
Adam
2006-May-22 04:17 UTC
[Rails] Re: [ANN] Mongrel 0.3.13 Bugs Update -- Change UID/GID Patch
Zed Shaw wrote:> Just a quick announce telling people to update the pre-release again. > Fixed and added the following goodies: > > * Bug where send_file wasn''t indicating that the body has been sent > which caused problems in a few situations. > * Bug where DirHandler wasn''t unescaping the URI paths. > * Patch from Bradley Taylor that gives mongrel_rails start the options > -u and -g. These will change the uid/gid on UNIX (not WIN32!) to the > requested ones. Please test this out on various Unix flavors and report > bugs. > * Spelling corrections (hot damn gvim is the bomb). > > > -- > Zed A. Shaw > http://www.zedshaw.com/ > http://mongrel.rubyforge.org/I noticed you have a placeholder for the documentation for deployment using Pen. Ezra has already posted that here http://brainspl.at/articles/2006/04/26/dead-simple-deployment . It worked for me so maybe you guys should get together and make it official. -- Posted via http://www.ruby-forum.com/.