From emmett at justin.tv Sun Jun 1 00:03:21 2008 From: emmett at justin.tv (Emmett Shear) Date: Sat, 31 May 2008 21:03:21 -0700 Subject: [Mongrel] Error: Mongrel timed out this thread: too many open files In-Reply-To: <7f4149bb0805311911w59765a0dh81df21290473425@mail.gmail.com> References: <860712640805291307y77c1fe17lf5ce6f62e2f027f5@mail.gmail.com> <20080529170256.082c580b.zedshaw@zedshaw.com> <7f4149bb0805311911w59765a0dh81df21290473425@mail.gmail.com> Message-ID: <860712640805312103w719aa29fyd82a3df273d8737d@mail.gmail.com> Looks like I was overloading the mongrels with connections...I took down the number of connections allowed in HAProxy and it looks like the problem went away. So, thanks! This has uncovered a new problem though, one that's truly baffling me: - Start up mongrel instances. Everything is awesome. Site is fast, life is good. - Wait 30-40 minutes. - Observe that updates and inserts in the database (postgres) are becoming slow. And by slow, I mean 30-40 seconds for a simple insert or update where it previously took less than 0.1 seconds. Load on DB server itself remains nominal; less than 2 on an 8 core box. No error messages of importance that I can see. Inserts and updates from other sources (script/console, psql) are fast. This started happening just after switching from fcgi to mongrels. Could it be something is different about how it handles database connections? Was I relying on some kind of bug before? E On Sat, May 31, 2008 at 7:11 PM, Brian Weaver wrote: > Emmett, > > Contrary to what Zed's message seems to imply, there is nothing > inherently wrong with codling like: > > a = FIle.open("blah.txt") > a.write("hi!") > a.close() > > You simply need to understand that if any error occurs during > a.write(...) or a similar call then a.close will not be invoked. If > you use error handling like > > a = FIle.open("blah.txt") > begin > a.write("hi!") > ensure > a.close() > end > > then you will ensure that the file is actually closed regardless of an > exception. Of course a block like that is kind of ugly, so it's better > to do what Zed suggested and actually associate a code block with the > open call. This means that even if the block faults the file is > closed; it's just a cleaner syntax. > > Here are some links that kind of explains it too: > > http://www.meshplex.org/wiki/Ruby/File_handling_Input_Output > http://www.math.hokudai.ac.jp/~gotoken/ruby/ruby-uguide/uguide25.html > > -- Brian > > On Thu, May 29, 2008 at 5:02 PM, Zed A. Shaw wrote: > > On Thu, 29 May 2008 13:07:27 -0700 > > "Emmett Shear" wrote: > > > >> I just switched to Mongrel, and it's been working much better than my > >> previous lighttpd/fastcgi setup. So thanks for the awesomeness. > >> > >> My current problem: once or twice an hour, I get following error in > >> production > >> > >> Mongrel timed out this thread: too many open files > >> > >> I never get it in testing or on our staging server. Any ideas what would > >> cause that? It doesn't *appear* particularly correlated with load to me, > but > >> I'm only receiving notifications after the fact so I can't be sure. > > > > A couple things cause this. One is that the mongrel is overloaded with > > too many connections so it can't accept any more. > > > > If there's isn't that much load on the server, then it's more likely > > that you are leaking an open file here or there. If you are doing code > > like this: > > > > a = open("blah.txt") > > a.write("hi") > > a.close() > > > > Then you are probably leaking files. Look for that, and then translate > > to the block form: > > > > open("blah.txt") {|a| a.write("hi") } > > > > That's probably the #1 mistake people make from other languages. > > > > -- > > Zed A. Shaw > > - Hate: http://savingtheinternetwithhate.com/ > > - Good: http://www.zedshaw.com/ > > - Evil: http://yearofevil.com/ > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > > > > -- > > /* insert witty comment here */ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zedshaw at zedshaw.com Sun Jun 1 02:07:15 2008 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sun, 1 Jun 2008 02:07:15 -0400 Subject: [Mongrel] Error: Mongrel timed out this thread: too many open files In-Reply-To: <860712640805312103w719aa29fyd82a3df273d8737d@mail.gmail.com> References: <860712640805291307y77c1fe17lf5ce6f62e2f027f5@mail.gmail.com> <20080529170256.082c580b.zedshaw@zedshaw.com> <7f4149bb0805311911w59765a0dh81df21290473425@mail.gmail.com> <860712640805312103w719aa29fyd82a3df273d8737d@mail.gmail.com> Message-ID: <20080601020715.0bea2055.zedshaw@zedshaw.com> On Sat, 31 May 2008 21:03:21 -0700 "Emmett Shear" wrote: > - Observe that updates and inserts in the database (postgres) are becoming > slow. And by slow, I mean 30-40 seconds for a simple insert or update where > it previously took less than 0.1 seconds. Load on DB server itself remains > nominal; less than 2 on an 8 core box. No error messages of importance that > I can see. Inserts and updates from other sources (script/console, psql) are > fast. Well, it sounds like your site already has some traffic. Without getting into a remote debugging session, have you checked your indexes to make sure you're adding the right ones to the right columns? If you were say entering a ton of strings into a DB and then querying for them with insane LIKE clauses, you'd see this kind of behavior. As you added more rows your app would get slower and slower. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From lists at ruby-forum.com Sun Jun 1 04:09:03 2008 From: lists at ruby-forum.com (Peder Linder) Date: Sun, 1 Jun 2008 10:09:03 +0200 Subject: [Mongrel] How to disable mongrel logs Message-ID: How do I disable mongrel's logging? -- Posted via http://www.ruby-forum.com/. From emmett at justin.tv Sun Jun 1 17:23:20 2008 From: emmett at justin.tv (Emmett Shear) Date: Sun, 1 Jun 2008 14:23:20 -0700 Subject: [Mongrel] Error: Mongrel timed out this thread: too many open files In-Reply-To: <20080601020715.0bea2055.zedshaw@zedshaw.com> References: <860712640805291307y77c1fe17lf5ce6f62e2f027f5@mail.gmail.com> <20080529170256.082c580b.zedshaw@zedshaw.com> <7f4149bb0805311911w59765a0dh81df21290473425@mail.gmail.com> <860712640805312103w719aa29fyd82a3df273d8737d@mail.gmail.com> <20080601020715.0bea2055.zedshaw@zedshaw.com> Message-ID: <860712640806011423jb7aec2n26b99ec3baae82d2@mail.gmail.com> At first, I thought I'd messed up something in the database too. But running the *exact* same updates and inserts against the production database, through the console, yields normal, fast results. The *only* place I see these 30-40 second updates/inserts is from mongrels that have been under load for a while; I don't see the slowness when running the exact same things from console, or from the old FCGI setup. What could be different about the doing the database queries in Mongrel that could cause this? I'm not too clear on exactly how Mongrel differs from FCGI, other than being faster and not using FCGI (the protocol). Could it be possible that the database connections are longer lived, or somehow shared between multiple threads, or something like that? I start with the assumption Mongrel does things the right way, and that I've made some mistake in configuring my application, but I'm at a loss as to where to start looking. Thanks, Emmett On Sat, May 31, 2008 at 11:07 PM, Zed A. Shaw wrote: > On Sat, 31 May 2008 21:03:21 -0700 > "Emmett Shear" wrote: > > > - Observe that updates and inserts in the database (postgres) are > becoming > > slow. And by slow, I mean 30-40 seconds for a simple insert or update > where > > it previously took less than 0.1 seconds. Load on DB server itself > remains > > nominal; less than 2 on an 8 core box. No error messages of importance > that > > I can see. Inserts and updates from other sources (script/console, psql) > are > > fast. > > Well, it sounds like your site already has some traffic. Without > getting into a remote debugging session, have you checked your indexes > to make sure you're adding the right ones to the right columns? > > If you were say entering a ton of strings into a DB and then querying > for them with insane LIKE clauses, you'd see this kind of behavior. As > you added more rows your app would get slower and slower. > > -- > Zed A. Shaw > - Hate: http://savingtheinternetwithhate.com/ > - Good: http://www.zedshaw.com/ > - Evil: http://yearofevil.com/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tikhon at scribd.com Mon Jun 2 09:04:56 2008 From: tikhon at scribd.com (Tikhon Bernstam) Date: Mon, 2 Jun 2008 06:04:56 -0700 Subject: [Mongrel] Error: Mongrel timed out this thread: too many open files In-Reply-To: <678738a20806020549i3ac4c63bn7b02cb2c9489baa2@mail.gmail.com> References: <678738a20806020549i3ac4c63bn7b02cb2c9489baa2@mail.gmail.com> Message-ID: <678738a20806020604w4b447b01yf097084c5ac4488c@mail.gmail.com> Hi Emmett, I've think I've seen the problem you've described when using acts_as_ferret + ferret DRb server (though I'll assume you aren't actually using ferret -- as the inimitable Engine Yard guys pointed out this weekend during one of their talks, ferret is a common cause of problems for their users. I haven't played with ferret in months btw, so this example might be outdated, but this example illustrates a more general problem, I think). in this ferret case, the problem, I believe, is that when you have some model Foo that uses acts_as_ferret and you call foo.save, the COMMIT on the save transaction occurs *after* the ferret after_create/after_update hooks. So the COMMIT occurs *after* the call to the ferret DRb server. Normally this is ok, but if you are indexing large amounts of text (e.g.) or the DRb server gets busy for whatever reason, we saw that the save transactions can suddenly take a long time. The example above illustrates a more general point, I think -- be careful with what you're doing in your AR hooks. Again, the problem is that when you save your AR object, that save is wrapped in a transaction, and the commit on that transaction occurs after the AR hooks like after_create. To verify this, here's a simple example: # script/generate model foo && rake db:migrate class Foo < ActiveRecord::Base after_create { sleep 10 } end # then from script/console foo = Foo.create # now watch your database -- the transaction begins, but the COMMIT doesn't occur until after the 10 seconds of sleep. So what plugins are you using? And are you using any interesting AR hooks that could potentially take a long time (like talking to a DRb server or uploading files to s3 as an after_create, for example)? Best, Tikhon Bernstam Co-founder, Scribd.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Mon Jun 2 16:37:09 2008 From: lists at ruby-forum.com (Grant Blakeman) Date: Mon, 2 Jun 2008 22:37:09 +0200 Subject: [Mongrel] Mongrel error since updating to OSX 10.5.3 In-Reply-To: <34C2EF08-E62C-4F35-BF16-E631DA6B1C9E@shotgunsoftware.com> References: <5585e6f106fdf2762fe2cf1ff53cae1c@ruby-forum.com> <34C2EF08-E62C-4F35-BF16-E631DA6B1C9E@shotgunsoftware.com> Message-ID: <490947117e3dd337ef48f1a67da332b0@ruby-forum.com> Matt Daw wrote: > Hi Woody, thanks, that fixed it for me. That explains the difference > in my app, the newer branches are on an up to date backgroundrb, while > the broken one is still on an ancient one. > > Matt Yeah, I was having the same issue and this worked for me too. Thanks for the tip! -gb -- Posted via http://www.ruby-forum.com/. From veganjenny at gmail.com Tue Jun 3 01:46:11 2008 From: veganjenny at gmail.com (jenny w) Date: Mon, 2 Jun 2008 22:46:11 -0700 Subject: [Mongrel] Passing environment variables to mongrel Message-ID: The Rails app I'm working on requires an environment variable to be set. I thought I could do this in my cap deploy script. Unfortunately, it seems that the Mongrel processes that are started up by Mongrel Cluster have their own environments and any environment variables set in the deploy script aren't passed on. I was able to verify this by having my deploy script run a rake task that outputs the value of of the environment variable I need -- the value is what I'd expect. I then set the Rails app to add that same environment variable in a log message, and it shows that the value is nil. Does anyone have any suggestions for setting an environment variable? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From veganjenny at gmail.com Tue Jun 3 02:13:01 2008 From: veganjenny at gmail.com (jenny w) Date: Mon, 2 Jun 2008 23:13:01 -0700 Subject: [Mongrel] Passing environment variables to mongrel In-Reply-To: References: Message-ID: Never mind; turns out this is a capistrano issue (running mongrel via sudo). Thanks! On Mon, Jun 2, 2008 at 10:46 PM, jenny w wrote: > The Rails app I'm working on requires an environment variable to be set. I > thought I could do this in my cap deploy script. Unfortunately, it seems > that the Mongrel processes that are started up by Mongrel Cluster have their > own environments and any environment variables set in the deploy script > aren't passed on. I was able to verify this by having my deploy script run a > rake task that outputs the value of of the environment variable I need -- > the value is what I'd expect. I then set the Rails app to add that same > environment variable in a log message, and it shows that the value is nil. > Does anyone have any suggestions for setting an environment variable? > > Thanks! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsiggelkow at mac.com Tue Jun 3 10:03:21 2008 From: bsiggelkow at mac.com (Bill Siggelkow) Date: Tue, 03 Jun 2008 07:03:21 -0700 Subject: [Mongrel] Passing environment variables to mongrel In-Reply-To: References: Message-ID: Jenny, Environment variables can be defined in the /etc/init.d/ mongrel_cluster script. Bill Siggelkow On Jun 2, 2008, at 10:46 PM, jenny w wrote: > The Rails app I'm working on requires an environment variable to be > set. I thought I could do this in my cap deploy script. > Unfortunately, it seems that the Mongrel processes that are started > up by Mongrel Cluster have their own environments and any > environment variables set in the deploy script aren't passed on. I > was able to verify this by having my deploy script run a rake task > that outputs the value of of the environment variable I need -- the > value is what I'd expect. I then set the Rails app to add that same > environment variable in a log message, and it shows that the value > is nil. > > Does anyone have any suggestions for setting an environment variable? > > Thanks! > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Jun 3 10:17:24 2008 From: lists at ruby-forum.com (Nicolas Escobar) Date: Tue, 3 Jun 2008 16:17:24 +0200 Subject: [Mongrel] Error: Mongrel timed out this thread: too many open files In-Reply-To: <678738a20806020604w4b447b01yf097084c5ac4488c@mail.gmail.com> References: <860712640805291307y77c1fe17lf5ce6f62e2f027f5@mail.gmail.com> <678738a20806020604w4b447b01yf097084c5ac4488c@mail.gmail.com> Message-ID: <4865fe94e3e065be71ef22598981487f@ruby-forum.com> Tikhon Bernstam wrote: > I've think I've seen the problem you've described when using > acts_as_ferret > + ferret DRb server I have exactly the same problem. Initially I was running acts_as_ferret with a DRb server in a mongrel_cluster and it was working ok. Then, I changed a field in a table and restarted the mongrel_cluster. It was then when it stopped working (same error as posted). I used the backup version and dropped the field that I created but the same happens. In 'development' enviroment with a single instance of mongrel it works though, using acts_as_ferret and DRb server. -- Posted via http://www.ruby-forum.com/. From rf at ufl.edu Tue Jun 3 17:09:05 2008 From: rf at ufl.edu (Randy Fischer) Date: Tue, 3 Jun 2008 17:09:05 -0400 Subject: [Mongrel] clients hang on large PUTs to Mongrel::HttpHandler-based web service Message-ID: Hi folks, I have a problem with a storage web service our group wrote using Mongrel::HttpHandler We have a consistent problem when using http PUT to this service when the data is larger than about 4 GB. The web service actually retrieves and processes the data, but the clients hang - the TCP connection is still in the ESTABLISHED state on the client side, but the TCP session no longer exists on the server side (the temporary file is unlinked from the directory and, somewhat later, from the mongrel process) I'm using mongrel 1.1.4, and as far as clients go, I've tried curl and a java-based application using the jakarta commons http client software - same issue. I'm wondering if this is a simple 32-bit int issue in the ragel-generated code? Any advice on how to approach debugging/fixing this would be appreciated - this is very repeatable. Work-arounds would be met with almost equal glee. Thanks, -Randy Fischer From zedshaw at zedshaw.com Tue Jun 3 20:16:05 2008 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 3 Jun 2008 20:16:05 -0400 Subject: [Mongrel] clients hang on large PUTs to Mongrel::HttpHandler-based web service In-Reply-To: References: Message-ID: <20080603201605.e2edb591.zedshaw@zedshaw.com> On Tue, 3 Jun 2008 17:09:05 -0400 "Randy Fischer" wrote: > Hi folks, > > I'm wondering if this is a simple 32-bit int issue in the ragel-generated > code? Shouldn't be, since the ragel code is only used to parse the headers, and when that's done it then just streams 16k chunks from the socket to a tempfile. Now, if your headers are 4G then I'd like to know how you did that since Mongrel would block you hard. Only thing that I could think of is that you aren't setting a size properly at some point. Either your header reports the wrong size, or you're not setting it. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From michael.dauria at gmail.com Tue Jun 3 20:30:52 2008 From: michael.dauria at gmail.com (Michael D'Auria) Date: Tue, 3 Jun 2008 20:30:52 -0400 Subject: [Mongrel] clients hang on large PUTs to Mongrel::HttpHandler-based web service In-Reply-To: <20080603201605.e2edb591.zedshaw@zedshaw.com> References: <20080603201605.e2edb591.zedshaw@zedshaw.com> Message-ID: <1907e2ca0806031730w309a61d9na2db7f683a8956a5@mail.gmail.com> Randy, Are you sure this is an issue with the size of the input and not the amount of time that the connection is left open? Michael On Tue, Jun 3, 2008 at 8:16 PM, Zed A. Shaw wrote: > On Tue, 3 Jun 2008 17:09:05 -0400 > "Randy Fischer" wrote: > > > Hi folks, > > > > I'm wondering if this is a simple 32-bit int issue in the ragel-generated > > code? > > Shouldn't be, since the ragel code is only used to parse the headers, > and when that's done it then just streams 16k chunks from the socket to > a tempfile. Now, if your headers are 4G then I'd like to know how you > did that since Mongrel would block you hard. > > Only thing that I could think of is that you aren't setting a size > properly at some point. Either your header reports the wrong size, or > you're not setting it. > > -- > Zed A. Shaw > - Hate: http://savingtheinternetwithhate.com/ > - Good: http://www.zedshaw.com/ > - Evil: http://yearofevil.com/ > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rf at ufl.edu Wed Jun 4 00:00:39 2008 From: rf at ufl.edu (Randy Fischer) Date: Wed, 4 Jun 2008 00:00:39 -0400 Subject: [Mongrel] clients hang on large PUTs to Mongrel::HttpHandler-based web service In-Reply-To: <1907e2ca0806031730w309a61d9na2db7f683a8956a5@mail.gmail.com> References: <20080603201605.e2edb591.zedshaw@zedshaw.com> <1907e2ca0806031730w309a61d9na2db7f683a8956a5@mail.gmail.com> Message-ID: On Tue, Jun 3, 2008 at 8:30 PM, Michael D'Auria wrote: > Randy, > Are you sure this is an issue with the size of the input and not the amount > of time that the connection is left open? > Michael I'll check by using a smaller filesize that I know will work, using curl's bandwidth limit feature to really increase the connection time. Thanks for the suggestion! -Randy From rf at ufl.edu Wed Jun 4 00:35:16 2008 From: rf at ufl.edu (Randy Fischer) Date: Wed, 4 Jun 2008 00:35:16 -0400 Subject: [Mongrel] clients hang on large PUTs to Mongrel::HttpHandler-based web service In-Reply-To: <20080603201605.e2edb591.zedshaw@zedshaw.com> References: <20080603201605.e2edb591.zedshaw@zedshaw.com> Message-ID: On Tue, Jun 3, 2008 at 8:16 PM, Zed A. Shaw wrote: > On Tue, 3 Jun 2008 17:09:05 -0400 > "Randy Fischer" wrote: >> >> I'm wondering if this is a simple 32-bit int issue in the ragel-generated >> code? > > Shouldn't be, since the ragel code is only used to parse the headers, > and when that's done it then just streams 16k chunks from the socket to > a tempfile. Now, if your headers are 4G then I'd like to know how you > did that since Mongrel would block you hard. Naw, it's the content length in the body of a PUT, I ask since I saw int content_length in http11_parser.c > Only thing that I could think of is that you aren't setting a size > properly at some point. Either your header reports the wrong size, or > you're not setting it. Easily double checked with tcpdump, and the curl dump headers stuff. And so I will - thanks for the suggestion. -Randy From zedshaw at zedshaw.com Wed Jun 4 16:18:29 2008 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 4 Jun 2008 16:18:29 -0400 Subject: [Mongrel] clients hang on large PUTs to Mongrel::HttpHandler-based web service In-Reply-To: References: <20080603201605.e2edb591.zedshaw@zedshaw.com> Message-ID: <20080604161829.892f35a8.zedshaw@zedshaw.com> On Wed, 4 Jun 2008 00:35:16 -0400 "Randy Fischer" wrote: > On Tue, Jun 3, 2008 at 8:16 PM, Zed A. Shaw wrote: > Naw, it's the content length in the body of a PUT, I ask since I saw > > int content_length Well, looking in the source I can't see where that's actually used to store the Content-Length header value. It actually seems to be dead. Instead you have this line in http_request.rb: content_length = @params[Const::CONTENT_LENGTH].to_i Now, that means it relies on Ruby's base integer type to store the content length: http://www.ruby-doc.org/core/classes/Fixnum.html ""A Fixnum holds Integer values that can be represented in a native machine word (minus 1 bit). If any operation on a Fixnum exceeds this range, the value is automatically converted to a Bignum."" Which is kind of vague, but there's a good chance it's implemented as a 32-bit signed integer giving you a problem with a 4G content size. It should be converted to a Bignum on overflow, but a quick test would be to check the class of the content_length right after this line to see what it's getting. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From ml at stiegerhs.de Wed Jun 4 12:37:43 2008 From: ml at stiegerhs.de (Ingmar Stieger) Date: Wed, 04 Jun 2008 18:37:43 +0200 Subject: [Mongrel] Mongrel as Windows service with normal privileges Message-ID: <4846C4D7.7020807@stiegerhs.de> I am trying to run Mongrel 1.1.5 with mongrel_service 0.3.4 on Ruby 1.8.6 with a "normal" user account, i.e. a user which belongs only to the Windows group "Users". The rationale behind this is that running a web server with full administrative rights (e.g. Local System) is not something that I would like to do. Unfortunately, starting the service from the services control panel results in the following error message: "The service did not respond to the start or control request in a timely fashion" (the error comes up very quickly, maybe 1 second max). This happens only if the user the service is configured to run as does not belong to the "Administrators" group, otherwise it works fine. I have read a couple of threads about this subject, so this is what I have already tried: (With psexec -l cmd.exe:) 1. mongrel_rails start -e development -a 127.0.0.1 -p 3000 ===> WORKS 2. mongrel_service console single -e development -a 127.0.0.1 -p 3000 ===> WORKS (Interactively logged in as the service user:) 3. mongrel_rails start -e development -a 127.0.0.1 -p 3000 ===> WORKS 4. mongrel_service console single -e development -a 127.0.0.1 -p 3000 ===> WORKS 5. Running the service with service user in Administrator group ===> WORKS 6. Running the service with service user only in Users (or Power Users) group ===> DOES NOT WORK I had to change a couple of NTFS security settings in order to get it run with normal privileges. Now the only thing that still does not work is #6. Unfortunately, no log files are being generated, especially ServiceFB.log is nowhere to be found. The server is Windows Server 2003 Standard, by the way. Could anybody please enlighten me how I could further analyze this problem ? I followed the advise here in the list as far as I could, but now I am at a loss. Thanks in advance, Ingmar From luislavena at gmail.com Wed Jun 4 17:57:00 2008 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 4 Jun 2008 18:57:00 -0300 Subject: [Mongrel] Mongrel as Windows service with normal privileges In-Reply-To: <4846C4D7.7020807@stiegerhs.de> References: <4846C4D7.7020807@stiegerhs.de> Message-ID: <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> On Wed, Jun 4, 2008 at 1:37 PM, Ingmar Stieger wrote: > I am trying to run Mongrel 1.1.5 with mongrel_service 0.3.4 on Ruby 1.8.6 > with a "normal" user account, i.e. a user which belongs only to the Windows > group "Users". The rationale behind this is that running a web server with > full administrative rights (e.g. Local System) is not something that I would > like to do. > > Unfortunately, starting the service from the services control panel results > in the following error message: "The service did not respond to the start or > control request in a timely fashion" (the error comes up very quickly, maybe > 1 second max). > > This happens only if the user the service is configured to run as does not > belong to the "Administrators" group, otherwise it works fine. > > I have read a couple of threads about this subject, so this is what I have > already tried: > > (With psexec -l cmd.exe:) > 1. mongrel_rails start -e development -a 127.0.0.1 -p 3000 > ===> WORKS > 2. mongrel_service console single -e development -a 127.0.0.1 -p 3000 > ===> WORKS > > (Interactively logged in as the service user:) > 3. mongrel_rails start -e development -a 127.0.0.1 -p 3000 > ===> WORKS > 4. mongrel_service console single -e development -a 127.0.0.1 -p 3000 > ===> WORKS > > 5. Running the service with service user in Administrator group > ===> WORKS > > 6. Running the service with service user only in Users (or Power Users) > group > ===> DOES NOT WORK > > I had to change a couple of NTFS security settings in order to get it run > with normal privileges. Now the only thing that still does not work is #6. > Unfortunately, no log files are being generated, especially ServiceFB.log > is nowhere to be found. The server is Windows Server 2003 Standard, by the > way. > 32bits or x64 editions? In any case, serviceFB.log and mongrel.log and mongrel_service.log should be stored into ruby/bin folder since was not possible by the service point to the directory of the service. I suggest you also try the psexec tool from Sysinternals and also runas program (builtin in Windows) to get more detail information. PATH reports from these environment will be help, also the security bits from the ACLs too, since if it runs as administrator maybe there is some file down there in your app (maybe log folder) that is not allowed to be written in it. > Could anybody please enlighten me how I could further analyze this problem ? > I followed the advise here in the list as far as I could, but now I am at a > loss. > It's hard to replicate all the environments, so please try go back to 0.3.3 which generates the servicefb.log file and see what it outputs. In any case, mongrel.log should always be generated. > Thanks in advance, > Ingmar HTH and please post your results so we can help you out. Regards, -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams From rf at ufl.edu Wed Jun 4 20:17:19 2008 From: rf at ufl.edu (Randy Fischer) Date: Wed, 4 Jun 2008 20:17:19 -0400 Subject: [Mongrel] clients hang on large PUTs to Mongrel::HttpHandler-based web service In-Reply-To: <20080604161829.892f35a8.zedshaw@zedshaw.com> References: <20080603201605.e2edb591.zedshaw@zedshaw.com> <20080604161829.892f35a8.zedshaw@zedshaw.com> Message-ID: Great! I'll check the content length - right now, it's looking to be some sort of network (maybe firewall) issue. When I have it figured out I will report back. But instrumenting the mongrel handler I wrote shows that it's attempting to put out a reasonable response header. Unfortunately security on this system is difficult - I just got sudo access to tcpdump... I started out as a sysadmin, but man, they drive me crazy sometimes... Did I say that mongrel rocks? Thanks Zed. -Randy >> On Tue, Jun 3, 2008 at 8:16 PM, Zed A. Shaw wrote: > >> Naw, it's the content length in the body of a PUT, I ask since I saw >> >> int content_length > > Well, looking in the source I can't see where that's actually used to > store the Content-Length header value. It actually seems to be dead. > Instead you have this line in http_request.rb: > > content_length = @params[Const::CONTENT_LENGTH].to_i > > [....] > Which is kind of vague, but there's a good chance it's implemented as a > 32-bit signed integer giving you a problem with a 4G content size. It > should be converted to a Bignum on overflow, but a quick test would be > to check the class of the content_length right after this line to see > what it's getting. From ml at stiegerhs.de Thu Jun 5 04:11:23 2008 From: ml at stiegerhs.de (Ingmar Stieger) Date: Thu, 05 Jun 2008 10:11:23 +0200 Subject: [Mongrel] Mongrel as Windows service with normal privileges In-Reply-To: <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> References: <4846C4D7.7020807@stiegerhs.de> <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> Message-ID: <48479FAA.70901@stiegerhs.de> Luis Lavena wrote: > 32bits or x64 editions? > Windows 2003 32bit. > In any case, serviceFB.log and mongrel.log and mongrel_service.log > should be stored into ruby/bin folder since was not possible by the > service point to the directory of the service. > Thanks for the hint of using mongrel_service 0.3.3. I get these log files now: servicefb.log: _initialize() constructor _initialize() constructor done ServiceProcess(new_name) ServiceProcess(new_name) done ServiceHost() ServiceHost() done ServiceHost.Add() _add_to_references() _add_to_references() done ServiceHost.Add() done ServiceController.RunMode() CurrentPID: 5108 ParentPID: 512 Error with OpenProcess GetLastError: 0The operation completed successfully. Parent Name: ServiceController.RunMode() done ServiceHost() destructor ServiceHost() destructor done ServiceProcess() destructor ServiceProcess() destructor done _terminate() destructor _terminate() destructor done mongrel_service.log: # Logfile created on 05.06.2008 09:51:06 native/mongrel_service.bas:44, mongrel_service.singlemongrel.constructor: redirecting to: c:\ruby\bin\mongrel.log Not very helpful - OpenProcess fails with no apparent error. > I suggest you also try the psexec tool from Sysinternals and also > runas program (builtin in Windows) to get more detail information. > Could you please explain what you want me to do ? I think I have ran everything I can using psexec and as the actual service user (explained in my initial post). If there is something else, I will happily run it :). On the other hand, since it works using these two methods, no error message will appear. Only the service itself can not be started. > PATH reports from these environment will be help, also the security > bits from the ACLs too, since if it runs as administrator maybe there > is some file down there in your app (maybe log folder) that is not > allowed to be written in it. > The app is a newly generated rails skeleton, and the user has "Full Control" on the directory and on the Ruby directory. I am not sure how I can get to the PATH variable when starting the service - any idea ? Thanks, Ingmar From ml at stiegerhs.de Thu Jun 5 05:23:40 2008 From: ml at stiegerhs.de (Ingmar Stieger) Date: Thu, 05 Jun 2008 11:23:40 +0200 Subject: [Mongrel] Mongrel as Windows service with normal privileges In-Reply-To: <48479FAA.70901@stiegerhs.de> References: <4846C4D7.7020807@stiegerhs.de> <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> <48479FAA.70901@stiegerhs.de> Message-ID: <4847B09C.1010606@stiegerhs.de> I digged a bit through the source code, and I am under the impression that a normal user may not query the service control manager with PROCESS_QUERY_INFORMATION. Could this be the case ? _process_name does not return the name and _process_name_dyn_psapi fails as well. (tested with 0.3.1 and 0.3.3). It looks like OpenProcess can not be used in this manner... In a totally unrelated project [1] I solved what I think you are trying to do here differently: I just pass the parameter "-runservice" from SCM in order to determine if the application should run as service (called from SCM) or as a normal console application. Maybe this would be an easier approach for mongrel_service as well ? I would create a proof of concept, but unfortunately, I am not proficient with FreeBasic... Bye, Ingmar [1] http://www.nwnx.org Ingmar Stieger wrote: > CurrentPID: 5108 > ParentPID: 512 > Error with OpenProcess > GetLastError: 0The operation completed successfully. > Parent Name: > ServiceController.RunMode() done > ServiceHost() destructor > ServiceHost() destructor done > ServiceProcess() destructor > ServiceProcess() destructor done > _terminate() destructor > _terminate() destructor done > From luislavena at gmail.com Thu Jun 5 06:10:10 2008 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 5 Jun 2008 12:10:10 +0200 Subject: [Mongrel] Mongrel as Windows service with normal privileges In-Reply-To: <48479FAA.70901@stiegerhs.de> References: <4846C4D7.7020807@stiegerhs.de> <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> <48479FAA.70901@stiegerhs.de> Message-ID: <71166b3b0806050310xd59701tcd4bf39fb14dcc97@mail.gmail.com> On Thu, Jun 5, 2008 at 10:11 AM, Ingmar Stieger wrote: > Luis Lavena wrote: >> >> 32bits or x64 editions? >> > > Windows 2003 32bit. >> >> In any case, serviceFB.log and mongrel.log and mongrel_service.log >> should be stored into ruby/bin folder since was not possible by the >> service point to the directory of the service. >> > > Thanks for the hint of using mongrel_service 0.3.3. I get these log files > now: > > servicefb.log: > > _initialize() constructor > _initialize() constructor done > ServiceProcess(new_name) > ServiceProcess(new_name) done > ServiceHost() > ServiceHost() done > ServiceHost.Add() > _add_to_references() > _add_to_references() done > ServiceHost.Add() done > ServiceController.RunMode() > CurrentPID: 5108 > ParentPID: 512 > Error with OpenProcess > GetLastError: 0The operation completed successfully. > Parent Name: > ServiceController.RunMode() done > ServiceHost() destructor > ServiceHost() destructor done > ServiceProcess() destructor > ServiceProcess() destructor done > _terminate() destructor > _terminate() destructor done > > mongrel_service.log: > > # Logfile created on 05.06.2008 09:51:06 > > native/mongrel_service.bas:44, mongrel_service.singlemongrel.constructor: > redirecting to: c:\ruby\bin\mongrel.log > > Not very helpful - OpenProcess fails with no apparent error. >> Because it couldn't get parent process name. >> I suggest you also try the psexec tool from Sysinternals and also >> runas program (builtin in Windows) to get more detail information. >> > > Could you please explain what you want me to do ? I think I have ran > everything I can using psexec and as the actual service user (explained in > my initial post). If there is something else, I will happily run it :). On > the other hand, since it works using these two methods, no error message > will appear. Only the service itself can not be started. On this ticket: http://rubyforge.org/tracker/?func=detail&atid=5145&aid=10820&group_id=1306 You can use PsExec tool [1] to simulate another user and remove administrative privileges for testing: You can search the mailing list and other tickets that explain how to perform it (was discussed several times). Can you provide the 'sc queryex' and 'sc qc' for your service and pastie it here? [1] http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams From luislavena at gmail.com Thu Jun 5 06:14:29 2008 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 5 Jun 2008 12:14:29 +0200 Subject: [Mongrel] Mongrel as Windows service with normal privileges In-Reply-To: <4847B09C.1010606@stiegerhs.de> References: <4846C4D7.7020807@stiegerhs.de> <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> <48479FAA.70901@stiegerhs.de> <4847B09C.1010606@stiegerhs.de> Message-ID: <71166b3b0806050314u306b19c2lcbc725563452ebed@mail.gmail.com> On Thu, Jun 5, 2008 at 11:23 AM, Ingmar Stieger wrote: > I digged a bit through the source code, and I am under the impression that a > normal user may not query the service control manager with > PROCESS_QUERY_INFORMATION. Could this be the case ? > Look at the source code for 0.3.4 you will find that a process can be opened for readonly functions and perform PROCESS_QUERY_INFORMATION without problems. That worked on 32 and 64 bits versions of many Windows Servers and XP, so shoudl work in your scenario too, unless that specific user lack the permission to "run and control services" which you will need to check with your sysadmin for that configuration. > _process_name does not return the name and _process_name_dyn_psapi fails as > well. (tested with 0.3.1 and 0.3.3). It looks like OpenProcess can not be > used in this manner... > > In a totally unrelated project [1] I solved what I think you are trying to > do here differently: > I just pass the parameter "-runservice" from SCM in order to determine if > the application should run as service (called from SCM) or as a normal > console application. Maybe this would be an easier approach for > mongrel_service as well ? > Basically mongrel_service inherited code from other project named ServiceFB, which is a framework we created for other purposes at the office. It worked without issues on lot of scenarios, and it automatically determine the running environment so you avoid the requirement to "analyze" the command line. > I would create a proof of concept, but unfortunately, I am not proficient > with FreeBasic... > Actually, it's basic, there are not too many keywords to worry about (ruby has more) and it's like C, I mean, you don't need to hack a lot of stuff to go low level :-) > Bye, > Ingmar HTH, -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams From ml at stiegerhs.de Thu Jun 5 08:04:15 2008 From: ml at stiegerhs.de (Ingmar Stieger) Date: Thu, 05 Jun 2008 14:04:15 +0200 Subject: [Mongrel] Mongrel as Windows service with normal privileges In-Reply-To: <71166b3b0806050310xd59701tcd4bf39fb14dcc97@mail.gmail.com> References: <4846C4D7.7020807@stiegerhs.de> <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> <48479FAA.70901@stiegerhs.de> <71166b3b0806050310xd59701tcd4bf39fb14dcc97@mail.gmail.com> Message-ID: <4847D63F.5050204@stiegerhs.de> Luis Lavena wrote: > On this ticket: > > http://rubyforge.org/tracker/?func=detail&atid=5145&aid=10820&group_id=1306 > > You can use PsExec tool [1] to simulate another user and remove > administrative privileges for testing: > Yes, it works with psexec. And it works running as the service user. If you have a look at my initial post, you can see the command line options I used for testing (nothing special here). > You can search the mailing list and other tickets that explain how to > perform it (was discussed several times). > > Can you provide the 'sc queryex' and 'sc qc' for your service and > pastie it here? > C:\>sc queryex rails3 SERVICE_NAME: rails3 TYPE : 10 WIN32_OWN_PROCESS STATE : 1 STOPPED (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 PID : 0 FLAGS : C:\>sc qc rails3 [SC] QueryServiceConfig SUCCESS SERVICE_NAME: rails3 TYPE : 10 WIN32_OWN_PROCESS START_TYPE : 3 DEMAND_START ERROR_CONTROL : 1 NORMAL BINARY_PATH_NAME : "c:/ruby/bin/mongrel_service.exe" single -e develop ment -p 3000 -a 127.0.0.1 -l "log/mongrel.log" -P "log/mongrel.pid" -c "C:/rails /x" -t 0 -r "public" -n 1024 LOAD_ORDER_GROUP : TAG : 0 DISPLAY_NAME : rails3 DEPENDENCIES : SERVICE_START_NAME : .\web C:\> I've just tested this on another, totally different machine: Windows XP Home Edition, German, Rails 2.1.0, restricted user account: No go. Parent Name: . Thanks for your efforts, Ingmar From luislavena at gmail.com Thu Jun 5 08:24:30 2008 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 5 Jun 2008 14:24:30 +0200 Subject: [Mongrel] Mongrel as Windows service with normal privileges In-Reply-To: <4847D63F.5050204@stiegerhs.de> References: <4846C4D7.7020807@stiegerhs.de> <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> <48479FAA.70901@stiegerhs.de> <71166b3b0806050310xd59701tcd4bf39fb14dcc97@mail.gmail.com> <4847D63F.5050204@stiegerhs.de> Message-ID: <71166b3b0806050524i29c373e3o165102acdf15011d@mail.gmail.com> On Thu, Jun 5, 2008 at 2:04 PM, Ingmar Stieger wrote: > Luis Lavena wrote: > >> On this ticket: >> >> >> http://rubyforge.org/tracker/?func=detail&atid=5145&aid=10820&group_id=1306 >> >> You can use PsExec tool [1] to simulate another user and remove >> administrative privileges for testing: >> > > Yes, it works with psexec. And it works running as the service user. If you > have a look at my initial post, you can see the command line options I used > for testing (nothing special here). > The thing is that looking at the initial post: 6. Running the service with service user only in Users (or Power Users) group ===> DOES NOT WORK This make me think that running as user is not working, but the thing is is not actually working under LocalSystem account, I'm correct? can you provide me the cacls output form C:\rails\x folder? >> You can search the mailing list and other tickets that explain how to >> perform it (was discussed several times). >> >> Can you provide the 'sc queryex' and 'sc qc' for your service and >> pastie it here? >> > > C:\>sc queryex rails3 > > SERVICE_NAME: rails3 > TYPE : 10 WIN32_OWN_PROCESS > STATE : 1 STOPPED > (NOT_STOPPABLE, NOT_PAUSABLE, > IGNORES_SHUTDOWN)) > > WIN32_EXIT_CODE : 0 (0x0) > SERVICE_EXIT_CODE : 0 (0x0) > CHECKPOINT : 0x0 > WAIT_HINT : 0x0 > PID : 0 > FLAGS : > > C:\>sc qc rails3 > [SC] QueryServiceConfig SUCCESS > > SERVICE_NAME: rails3 > TYPE : 10 WIN32_OWN_PROCESS > START_TYPE : 3 DEMAND_START > ERROR_CONTROL : 1 NORMAL > BINARY_PATH_NAME : "c:/ruby/bin/mongrel_service.exe" single -e > develop > ment -p 3000 -a 127.0.0.1 -l "log/mongrel.log" -P "log/mongrel.pid" -c > "C:/rails > /x" -t 0 -r "public" -n 1024 > LOAD_ORDER_GROUP : > TAG : 0 > DISPLAY_NAME : rails3 > DEPENDENCIES : > SERVICE_START_NAME : .\web > SERVICE_START_NAME looks like web is the username used? > C:\> > > I've just tested this on another, totally different machine: Windows XP Home > Edition, German, Rails 2.1.0, restricted user account: No go. Parent Name: > . > I made a test application when this was shown the first time, can you please try with it and provide me the output. Thanks, -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams -------------- next part -------------- A non-text attachment was scrubbed... Name: proc_info_3.7z Type: application/x-7z-compressed Size: 12719 bytes Desc: not available URL: From ml at stiegerhs.de Thu Jun 5 09:00:17 2008 From: ml at stiegerhs.de (Ingmar Stieger) Date: Thu, 05 Jun 2008 15:00:17 +0200 Subject: [Mongrel] Mongrel as Windows service with normal privileges In-Reply-To: <71166b3b0806050524i29c373e3o165102acdf15011d@mail.gmail.com> References: <4846C4D7.7020807@stiegerhs.de> <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> <48479FAA.70901@stiegerhs.de> <71166b3b0806050310xd59701tcd4bf39fb14dcc97@mail.gmail.com> <4847D63F.5050204@stiegerhs.de> <71166b3b0806050524i29c373e3o165102acdf15011d@mail.gmail.com> Message-ID: <4847E361.3060202@stiegerhs.de> > > The thing is that looking at the initial post: > > 6. Running the service with service user only in Users (or Power Users) group > ===> DOES NOT WORK > > This make me think that running as user is not working, but the thing > is is not actually working under LocalSystem account, I'm correct? > Sorry if that was not clear. It does work as service under LocalSystem but it does not work as service under user "web". >> C:\>sc qc rails3 >> [SC] QueryServiceConfig SUCCESS >> >> SERVICE_NAME: rails3 >> TYPE : 10 WIN32_OWN_PROCESS >> START_TYPE : 3 DEMAND_START >> ERROR_CONTROL : 1 NORMAL >> BINARY_PATH_NAME : "c:/ruby/bin/mongrel_service.exe" single -e >> develop >> ment -p 3000 -a 127.0.0.1 -l "log/mongrel.log" -P "log/mongrel.pid" -c >> "C:/rails >> /x" -t 0 -r "public" -n 1024 >> LOAD_ORDER_GROUP : >> TAG : 0 >> DISPLAY_NAME : rails3 >> DEPENDENCIES : >> SERVICE_START_NAME : .\web > > SERVICE_START_NAME looks like web is the username used? > Yes, "web" is the restricted user. > I made a test application when this was shown the first time, can you > please try with it and provide me the output. > I've added a small INPUT "Press Enter.", s line at the end. This is the output: runas /user:web proc_info.exe *** CURRENT PROCESS *** EnumProcessModules (PID, name): 3904 proc_info.exe Module32First (PID, name): 3904 proc_info.exe GetProcessImageFileName (PID, name): 3904 \Device\HarddiskVolume5\Temp\proc_info .exe *** PARENT PROCESS *** EnumProcessModules (PID, name): 244 Error with OpenProcess GetLastError: 5Zugriff verweigert Module32First (PID, name): 244 Error Creating Snap (SNAPMODULE) GetLastError: 5Zugriff verweigert GetProcessImageFileName (PID, name): 244 Error with OpenProcess GetLastError: 5Zugriff verweigert Press Enter. Zugriff verweigert = Access denied. I think this confirms my suspicion that the normal user "web" may not query the parent process. What do you think ? Bye, Ingmar -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis at area17.com Thu Jun 5 09:46:31 2008 From: luis at area17.com (Luis Lavena) Date: Thu, 5 Jun 2008 15:46:31 +0200 Subject: [Mongrel] Mongrel as Windows service with normal privileges In-Reply-To: <4847E361.3060202@stiegerhs.de> References: <4846C4D7.7020807@stiegerhs.de> <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> <48479FAA.70901@stiegerhs.de> <71166b3b0806050310xd59701tcd4bf39fb14dcc97@mail.gmail.com> <4847D63F.5050204@stiegerhs.de> <71166b3b0806050524i29c373e3o165102acdf15011d@mail.gmail.com> <4847E361.3060202@stiegerhs.de> Message-ID: <71166b3b0806050646y762a5a80i63a9773d7b7908ce@mail.gmail.com> On Thu, Jun 5, 2008 at 3:00 PM, Ingmar Stieger wrote: > [...] > > runas /user:web proc_info.exe > > *** CURRENT PROCESS *** > EnumProcessModules (PID, name): 3904 proc_info.exe > Module32First (PID, name): 3904 proc_info.exe > GetProcessImageFileName (PID, name): 3904 > \Device\HarddiskVolume5\Temp\proc_info > .exe > > *** PARENT PROCESS *** > EnumProcessModules (PID, name): 244 Error with OpenProcess > GetLastError: 5Zugriff verweigert > > Module32First (PID, name): 244 Error Creating Snap (SNAPMODULE) > GetLastError: 5Zugriff verweigert > > GetProcessImageFileName (PID, name): 244 Error with OpenProcess > GetLastError: 5Zugriff verweigert > > Press Enter. > Hmn, looks like user web user is too limited to do anything. > Zugriff verweigert = Access denied. > > I think this confirms my suspicion that the normal user "web" may not query > the parent process. What do you think ? > How normal is normal? I mean, it can log in? it has applied some group policy stuff in it? Just for the sake of testing, can you create a "limited" account using the control panel and try running proc_info.exe with it? With that info maybe I can figure out what's wrong. Thanks for your time, -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams From ml at stiegerhs.de Thu Jun 5 10:19:03 2008 From: ml at stiegerhs.de (Ingmar Stieger) Date: Thu, 05 Jun 2008 16:19:03 +0200 Subject: [Mongrel] Mongrel as Windows service with normal privileges In-Reply-To: <71166b3b0806050646y762a5a80i63a9773d7b7908ce@mail.gmail.com> References: <4846C4D7.7020807@stiegerhs.de> <71166b3b0806041457k5ba2ea82s300726358ead8288@mail.gmail.com> <48479FAA.70901@stiegerhs.de> <71166b3b0806050310xd59701tcd4bf39fb14dcc97@mail.gmail.com> <4847D63F.5050204@stiegerhs.de> <71166b3b0806050524i29c373e3o165102acdf15011d@mail.gmail.com> <4847E361.3060202@stiegerhs.de> <71166b3b0806050646y762a5a80i63a9773d7b7908ce@mail.gmail.com> Message-ID: <4847F5D7.8050105@stiegerhs.de> Luis Lavena wrote: > Hmn, looks like user web user is too limited to do anything. Interesting: The result of proc_info.exe is different when I log in interactively with the "web" user: *** CURRENT PROCESS *** EnumProcessModules (PID, name): 228 proc_info.exe Module32First (PID, name): 228 proc_info.exe GetProcessImageFileName (PID, name): 228 \Device\HarddiskVolume5\Temp\proc_info .exe *** PARENT PROCESS *** EnumProcessModules (PID, name): 3312 cmd.exe Module32First (PID, name): 3312 cmd.exe GetProcessImageFileName (PID, name): 3312 \Device\HarddiskVolume1\WINDOWS\system 32\cmd.exe Press Enter. The previous attempt with "runas" had PID 244 as parent process id, which at that time was "svchost.exe". The full process hierarchy looked like this (gathered with Process Explorer): System - smss.exe - winlogon.exe - services.exe - svchost.exe - proc_info.exe It seems not to be only the user, but also the way the executeable is started. The "web" user may query its parent process if it is cmd.exe, but not if the parent is svchost.exe. I do not know how svchost starts its child processes, but apparently with less rights than the command shell does... > How normal is normal? I mean, it can log in? it has applied some group > policy stuff in it? > > Just for the sake of testing, can you create a "limited" account using > the control panel and try running proc_info.exe with it? > > With that info maybe I can figure out what's wrong. > > Thanks for your time, > The "normal" user may run the whole rails stack as service without problems. I hacked ServiceFB_Utils.bas to ignore the result of parent_name, and now it works as expected (btw, you are right, FreeBasic isnt' that hard :)) with limited rights. The test was run on the isolated XP home machine, so no group policies are in effect. Hope this helps, Ingmar From lists at ruby-forum.com Thu Jun 5 16:14:20 2008 From: lists at ruby-forum.com (Frank Lawrence) Date: Thu, 5 Jun 2008 22:14:20 +0200 Subject: [Mongrel] Cluster shutdown on web farm when using clustered filesystem Message-ID: <4bf637f8137f7d921b8a960dbf3cb728@ruby-forum.com> Hi, I have a number of servers running mongrel cluster all of whom feed off of a shared filesystem (OCFS2). Each cluster has its own mongrel_cluster_web2.yml file with distinct PID and Log file names. In theory they shouldn't be aware of each other's presence. What I have found is that when I want to test a new set of code on one server and I shut one server's mongrel cluster down, all of its peers shutdown as well. Any ideas as to how this is possible? I am running mongrel 1.1.4 on Centos5.1, fully patched. Thanks, Frank -- Posted via http://www.ruby-forum.com/. From seatmanu at gmail.com Thu Jun 5 16:45:50 2008 From: seatmanu at gmail.com (Emmanuel Pinault) Date: Thu, 5 Jun 2008 13:45:50 -0700 Subject: [Mongrel] Static files and mongrel Message-ID: <9A86DEE6-8ADF-4383-8B29-27CAEA8F6B2D@gmail.com> Hi how does mongrel (without rails or merb) handles Static files? Do I have to create a handler for static file handling? Thanks Emmanuel From wyhaines at gmail.com Thu Jun 5 17:13:21 2008 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 5 Jun 2008 15:13:21 -0600 Subject: [Mongrel] Static files and mongrel In-Reply-To: <9A86DEE6-8ADF-4383-8B29-27CAEA8F6B2D@gmail.com> References: <9A86DEE6-8ADF-4383-8B29-27CAEA8F6B2D@gmail.com> Message-ID: On Thu, Jun 5, 2008 at 2:45 PM, Emmanuel Pinault wrote: > Hi > > how does mongrel (without rails or merb) handles Static files? Do I have to > create a handler for static file handling? Use the DirHandler. It's one of the standard handlers bundled with Mongrel. If you look at the Mongrel code, it is in the mongrel/handlers.rb file. The general advice, to let whatever is upstream of Mongrel handle static files, is good advice, though. Kirk Haines From seatmanu at gmail.com Thu Jun 5 17:52:40 2008 From: seatmanu at gmail.com (Emmanuel Pinault) Date: Thu, 5 Jun 2008 14:52:40 -0700 Subject: [Mongrel] Static files and mongrel In-Reply-To: References: <9A86DEE6-8ADF-4383-8B29-27CAEA8F6B2D@gmail.com> Message-ID: <7057E9DB-F268-4694-B375-6D987675C33C@gmail.com> Oh, I though it was just for Directory listing. Does it handle automatically the MIME type? I see in the doc that there are references to a mimes.yml thanks for the advice. This is not meant for production system but more simulator so should be fine. Otherwise I use Apache or any other web server usually to pick up the static files then have mongrel just handle dynamic part Thanks Emmanuel On Jun 5, 2008, at 2:13 PM, Kirk Haines wrote: > On Thu, Jun 5, 2008 at 2:45 PM, Emmanuel Pinault > wrote: >> Hi >> >> how does mongrel (without rails or merb) handles Static files? Do I >> have to >> create a handler for static file handling? > > Use the DirHandler. It's one of the standard handlers bundled with > Mongrel. If you look at the Mongrel code, it is in the > mongrel/handlers.rb file. > > The general advice, to let whatever is upstream of Mongrel handle > static files, is good advice, though. > > > Kirk Haines > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From seatmanu at gmail.com Thu Jun 5 20:00:10 2008 From: seatmanu at gmail.com (Emmanuel Pinault) Date: Thu, 5 Jun 2008 17:00:10 -0700 Subject: [Mongrel] logging? Message-ID: <16CC19A3-6571-4ABA-9023-65EFBDDF6BDF@gmail.com> Is there a simple way to turn on./off logging ? or do I have to build my own? Trying to see all the request coming in (like access log in apache) thanks Emmanuel From gwolf at gwolf.org Thu Jun 5 17:08:06 2008 From: gwolf at gwolf.org (Gunnar Wolf) Date: Thu, 5 Jun 2008 16:08:06 -0500 Subject: [Mongrel] Why not ignore stale PID files? Message-ID: <20080605210804.GB30838@cajita.gateway.2wire.net> Hi, I have an application which is dying horrible deaths (i.e. segmentation faults) in mid-flight, in production... And of course, I should fix it. But while I find and fix the bugs, I found something I think should be different - I can work on submitting a patch, as it is quite simple, but I might be losing something on my rationale. When Mongrel segfaults, it does not -obviously- get to clean up after itself, so it does not remove the PID files. As an example: $ sudo /etc/init.d/mongrel-cluster start Starting mongrel-cluster: Starting all mongrel_clusters... mongrel-cluster. $ sudo cat tmp/pids/mongrel.8203.pid | xargs kill -9 $ sudo /etc/init.d/mongrel-cluster status (...) found pid_file: tmp/pids/mongrel.8203.pid missing mongrel_rails: port 8203 (...) $ sudo /etc/init.d/mongrel-cluster restart Restarting mongrel-cluster: Restarting all mongrel_clusters... ** !!! PID file tmp/pids/mongrel.8203.pid already exists. Mongrel could be running already. Check your log/mongrel.8203.log for errors. ** !!! Exiting with error. You must stop mongrel and clear the .pid before I'll attempt a start. mongrel-cluster. So, what's the solution? I must manually do: $ sudo rm tmp/pids/mongrel.8203.pid $ sudo /etc/init.d/mongrel-cluster restart And now it works. What should happen? Well, 'status' already found that there is a stale PID. Of course, the 'status' action means exactly that: Get the status, do nothing else. But the 'stop' action should clean the PIDs if they do no longer exist, and the 'start' action should check whether the process with that PID is alive, and ignore it if it's not. At least, this behaviour should be specifiable via the configuration file. What do you think? -- Gunnar Wolf - gwolf at iiec.unam.mx - (+52-55)5623-0154 / 1451-2244 PGP key 1024D/8BB527AF 2001-10-23 Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF From tikhon at scribd.com Thu Jun 5 22:29:22 2008 From: tikhon at scribd.com (Tikhon Bernstam) Date: Thu, 5 Jun 2008 19:29:22 -0700 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: <20080605210804.GB30838@cajita.gateway.2wire.net> References: <20080605210804.GB30838@cajita.gateway.2wire.net> Message-ID: <678738a20806051929x6a9f34aao8641f915ced55a9c@mail.gmail.com> use the mongrel_cluster --clean option On 6/5/08, Gunnar Wolf wrote: > > Hi, > > I have an application which is dying horrible deaths > (i.e. segmentation faults) in mid-flight, in production... And of > course, I should fix it. But while I find and fix the bugs, I found > something I think should be different - I can work on submitting a > patch, as it is quite simple, but I might be losing something on my > rationale. > > When Mongrel segfaults, it does not -obviously- get to clean up after > itself, so it does not remove the PID files. As an example: > > $ sudo /etc/init.d/mongrel-cluster start > Starting mongrel-cluster: Starting all mongrel_clusters... > mongrel-cluster. > $ sudo cat tmp/pids/mongrel.8203.pid | xargs kill -9 > $ sudo /etc/init.d/mongrel-cluster status > (...) > found pid_file: tmp/pids/mongrel.8203.pid > missing mongrel_rails: port 8203 > (...) > $ sudo /etc/init.d/mongrel-cluster restart > Restarting mongrel-cluster: Restarting all mongrel_clusters... > ** !!! PID file tmp/pids/mongrel.8203.pid already exists. Mongrel could be > running already. Check your log/mongrel.8203.log for errors. > ** !!! Exiting with error. You must stop mongrel and clear the .pid before > I'll attempt a start. > mongrel-cluster. > > So, what's the solution? I must manually do: > > $ sudo rm tmp/pids/mongrel.8203.pid > $ sudo /etc/init.d/mongrel-cluster restart > > And now it works. > > What should happen? Well, 'status' already found that there is a stale > PID. Of course, the 'status' action means exactly that: Get the > status, do nothing else. But the 'stop' action should clean the PIDs > if they do no longer exist, and the 'start' action should check > whether the process with that PID is alive, and ignore it if it's > not. At least, this behaviour should be specifiable via the > configuration file. > > What do you think? > > > -- > Gunnar Wolf - gwolf at iiec.unam.mx - (+52-55)5623-0154 / 1451-2244 > PGP key 1024D/8BB527AF 2001-10-23 > Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zedshaw at zedshaw.com Fri Jun 6 01:01:32 2008 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Fri, 6 Jun 2008 01:01:32 -0400 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: <20080605210804.GB30838@cajita.gateway.2wire.net> References: <20080605210804.GB30838@cajita.gateway.2wire.net> Message-ID: <20080606010132.06ae086e.zedshaw@zedshaw.com> On Thu, 5 Jun 2008 16:08:06 -0500 Gunnar Wolf wrote: > What should happen? Well, 'status' already found that there is a stale > PID. Of course, the 'status' action means exactly that: Get the > status, do nothing else. But the 'stop' action should clean the PIDs > if they do no longer exist, and the 'start' action should check > whether the process with that PID is alive, and ignore it if it's > not. At least, this behaviour should be specifiable via the > configuration file. That would be the ideal situation, but Ruby doesn't have good enough process management APIs to do this portably. To make it work you'd have to portably be able to take a PID and see if there's a mongrel running with that PID. You can't use /proc or /sys because that's linux only. You can't use `ps` because the OSX morons changed everything, Solaris has different format, etc. If you were to do this, you'd have to dip into C code to pull it off. Now, if you're only on linux then you could write yourself a small little hack to the mongrel_rails script that did this with info out of /proc. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From erik.hetzner at ucop.edu Fri Jun 6 13:48:19 2008 From: erik.hetzner at ucop.edu (Erik Hetzner) Date: Fri, 06 Jun 2008 10:48:19 -0700 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: <20080605210804.GB30838@cajita.gateway.2wire.net> References: <20080605210804.GB30838@cajita.gateway.2wire.net> Message-ID: At Thu, 5 Jun 2008 16:08:06 -0500, Gunnar Wolf wrote: > Hi, > > I have an application which is dying horrible deaths > (i.e. segmentation faults) in mid-flight, in production... And of > course, I should fix it. But while I find and fix the bugs, I found > something I think should be different - I can work on submitting a > patch, as it is quite simple, but I might be losing something on my > rationale. > > [?] I use the following bit in my Capistrano scripts before I start Mongrel: ( [ -f pid_file ] && ( kill -0 `cat pid_file` >& /dev/null || rm pid_file ) ) which handles the typical cases (in which no process with a given pid is running, or a process is running with a different owner from the mongrel owner) but not the edge case where a process is running, with the same owner, but is no longer a mongrel process. You could supplement this with Linux/Solaris specific stuff to check if the process running is actually a mongrel. best, Erik Hetzner -------------- next part -------------- ;; Erik Hetzner, California Digital Library ;; gnupg key id: 1024D/01DB07E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From mental at rydia.net Fri Jun 6 14:18:36 2008 From: mental at rydia.net (MenTaLguY) Date: Fri, 06 Jun 2008 14:18:36 -0400 Subject: [Mongrel] package needed: fastthread-1.0.2 Message-ID: <1212776316.19860.6.camel@localhost> I've just committed the makings of fastthread-1.0.2 to SVN, fixing a couple long-standing bugs in 1.0.1: - merged the fix from ruby_1_8 to avoid rb_bugging during exit with waiting threads - SizedQueue#enq is now defined properly Could you or whoever does the signed gems please turn the crank and upload the new gems? Thanks, -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From leccine at gmail.com Fri Jun 6 14:48:44 2008 From: leccine at gmail.com (Istvan Szukacs) Date: Fri, 06 Jun 2008 19:48:44 +0100 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: References: <20080605210804.GB30838@cajita.gateway.2wire.net> Message-ID: <4849868C.9030805@gmail.com> kill -0 `cat pid_file` >& /dev/null more like kill -0 $(& /dev/null regards, Istvan Erik Hetzner wrote: > At Thu, 5 Jun 2008 16:08:06 -0500, > Gunnar Wolf wrote: > >> Hi, >> >> I have an application which is dying horrible deaths >> (i.e. segmentation faults) in mid-flight, in production... And of >> course, I should fix it. But while I find and fix the bugs, I found >> something I think should be different - I can work on submitting a >> patch, as it is quite simple, but I might be losing something on my >> rationale. >> >> [?] >> > > I use the following bit in my Capistrano scripts before I start > Mongrel: > > ( [ -f pid_file ] && ( kill -0 `cat pid_file` >& /dev/null || rm pid_file ) ) > > which handles the typical cases (in which no process with a given pid > is running, or a process is running with a different owner from the > mongrel owner) but not the edge case where a process is running, with > the same owner, but is no longer a mongrel process. You could > supplement this with Linux/Solaris specific stuff to check if the > process running is actually a mongrel. > > best, > Erik Hetzner > > ------------------------------------------------------------------------ > > ;; Erik Hetzner, California Digital Library > ;; gnupg key id: 1024D/01DB07E3 > > ------------------------------------------------------------------------ > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From gwolf at gwolf.org Fri Jun 6 17:13:10 2008 From: gwolf at gwolf.org (Gunnar Wolf) Date: Fri, 6 Jun 2008 16:13:10 -0500 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: <20080606010132.06ae086e.zedshaw@zedshaw.com> References: <20080605210804.GB30838@cajita.gateway.2wire.net> <20080606010132.06ae086e.zedshaw@zedshaw.com> Message-ID: <20080606211309.GJ13547@cajita.gateway.2wire.net> Zed A. Shaw dijo [Fri, Jun 06, 2008 at 01:01:32AM -0400]: > That would be the ideal situation, but Ruby doesn't have good enough > process management APIs to do this portably. To make it work you'd > have to portably be able to take a PID and see if there's a mongrel > running with that PID. > > You can't use /proc or /sys because that's linux only. You can't use > `ps` because the OSX morons changed everything, Solaris has different > format, etc. > > If you were to do this, you'd have to dip into C code to pull it off. > > Now, if you're only on linux then you could write yourself a small > little hack to the mongrel_rails script that did this with info out > of /proc. Oh, silly me... I thought Ruby's Process class did with the architectural incompatibilities... What I wrote to check for the status is quite straightforward: ------------------------------------------------------------ #!/usr/bin/ruby require 'yaml' confdir = '/etc/mongrel-cluster/sites-enabled' restart_cmd = '/etc/init.d/mongrel-cluster restart' needs_restart = false (Dir.open(confdir).entries - ['.', '..']).each do |site| conf = YAML.load_file "#{confdir}/#{site}" pid_location = [conf['cwd'], conf['pid_file']].join('/').gsub(/\.pid$/, '*.pid') pid_files = Dir.glob(pid_location) pid_files.each do |pidf| pid = File.read(pidf) begin Process.getpgid(pid.to_i) rescue Errno::ESRCH warn "Process #{pid} (cluster #{site}) is dead!" File.unlink pidf needs_restart = true end end end system(restart_cmd) if needs_restart ------------------------------------------------------------ (periodically run via cron) I guess this works in any Unixy environment... I have no idea on whether Windows implements something similar to Process.getpgid, or for that matter, anything on Windows' process management. Greetings, -- Gunnar Wolf - gwolf at gwolf.org - (+52-55)5623-0154 / 1451-2244 PGP key 1024D/8BB527AF 2001-10-23 Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF From gwolf at gwolf.org Fri Jun 6 17:13:49 2008 From: gwolf at gwolf.org (Gunnar Wolf) Date: Fri, 6 Jun 2008 16:13:49 -0500 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: <678738a20806051929x6a9f34aao8641f915ced55a9c@mail.gmail.com> References: <20080605210804.GB30838@cajita.gateway.2wire.net> <678738a20806051929x6a9f34aao8641f915ced55a9c@mail.gmail.com> Message-ID: <20080606211349.GK13547@cajita.gateway.2wire.net> Tikhon Bernstam dijo [Thu, Jun 05, 2008 at 07:29:22PM -0700]: > use the mongrel_cluster --clean option Very good addition to the overall logic, keeps things cleaner :-) -- Gunnar Wolf - gwolf at gwolf.org - (+52-55)5623-0154 / 1451-2244 PGP key 1024D/8BB527AF 2001-10-23 Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF From evan at cloudbur.st Fri Jun 6 18:50:41 2008 From: evan at cloudbur.st (Evan Weaver) Date: Fri, 6 Jun 2008 15:50:41 -0700 Subject: [Mongrel] package needed: fastthread-1.0.2 In-Reply-To: <1212776316.19860.6.camel@localhost> References: <1212776316.19860.6.camel@localhost> Message-ID: Yeah, I can do it soonish. Thanks for the fixes. Evan On Fri, Jun 6, 2008 at 11:18 AM, MenTaLguY wrote: > I've just committed the makings of fastthread-1.0.2 to SVN, fixing a > couple long-standing bugs in 1.0.1: > > - merged the fix from ruby_1_8 to avoid rb_bugging during exit with > waiting threads > > - SizedQueue#enq is now defined properly > > Could you or whoever does the signed gems please turn the crank and > upload the new gems? > > Thanks, > > -mental > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Evan Weaver From normalperson at yhbt.net Fri Jun 6 19:18:03 2008 From: normalperson at yhbt.net (Eric Wong) Date: Fri, 6 Jun 2008 16:18:03 -0700 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: <20080606211309.GJ13547@cajita.gateway.2wire.net> References: <20080605210804.GB30838@cajita.gateway.2wire.net> <20080606010132.06ae086e.zedshaw@zedshaw.com> <20080606211309.GJ13547@cajita.gateway.2wire.net> Message-ID: <20080606231803.GE5966@yp-box.dyndns.org> Gunnar Wolf wrote: > Zed A. Shaw dijo [Fri, Jun 06, 2008 at 01:01:32AM -0400]: > > That would be the ideal situation, but Ruby doesn't have good enough > > process management APIs to do this portably. To make it work you'd > > have to portably be able to take a PID and see if there's a mongrel > > running with that PID. > > > > You can't use /proc or /sys because that's linux only. You can't use > > `ps` because the OSX morons changed everything, Solaris has different > > format, etc. > > > > If you were to do this, you'd have to dip into C code to pull it off. > > > I guess this works in any Unixy environment... I have no idea on > whether Windows implements something similar to Process.getpgid, or > for that matter, anything on Windows' process management. Process.kill(0, pid) also works and is (in my experience) more widely used. -- Eric Wong From emmett.shear at gmail.com Fri Jun 6 21:03:51 2008 From: emmett.shear at gmail.com (Emmett Shear) Date: Fri, 6 Jun 2008 18:03:51 -0700 Subject: [Mongrel] Fresh install on Debian Etch - Mongrel immediately hangs In-Reply-To: <4ea46f9997d961b0d989f36548cc916c@ruby-forum.com> References: <400507f5e01b232f42e8151da8e6ea1d@ruby-forum.com> <71166b3b0712170126y4b02484bldce7249770b6e35e@mail.gmail.com> <4ea46f9997d961b0d989f36548cc916c@ruby-forum.com> Message-ID: <860712640806061803l3b9205e2ob7df8f30d3315ec4@mail.gmail.com> I just had the same exact problem with the same solution. The wrong platform of fastthread was installed, which was causing mongrel to spin. That should probably dump with a stacktrace instead of spinning, I'll see if I can learn enough mongrel to write a patch. Emmett On Mon, Dec 17, 2007 at 2:43 AM, Paolo Capriotti wrote: > Luis Lavena wrote: > > On Dec 17, 2007 6:15 AM, Paolo Capriotti wrote: > > [...] > >> > >> I've found that mongrel tries to require some library repeatedly, > >> because it gets an unrelated exception while trying to load it. For me, > >> the missing library was actually fastthread, and installing it solved > >> the problem. > >> To find out what is the actual error, add a print statement after line 8 > >> in lib/mongrel/gems.rb. > >> > >> Hope that helps, > >> > > > > Paolo, you can confirm this behavior happens also with "mongrel_rails" > > and not just script/server? > > Yes, it did happen. After installing fastthread, I can't reproduce it > anymore if I uninstall it. mongrel_rails now exits with a clean > backtrace when started without fastthread installed, and script/server > runs webrick instead. > I don't know what exactly was causing the problem... maybe a wrong > installed version of fastthread? The exception caught in > lib/mongrel/gems.rb:8 was: > 'no such file to load -- fastthread' - sorry, I didn't save the > backtrace. > > Paolo Capriotti > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seatmanu at gmail.com Fri Jun 6 21:10:04 2008 From: seatmanu at gmail.com (Emmanuel Pinault) Date: Fri, 6 Jun 2008 18:10:04 -0700 Subject: [Mongrel] Mongrel access logs? Message-ID: <3E619450-5BF7-45F3-9B10-BD20CEED01F5@gmail.com> Hi How do I turn on/off the mongrel access logs? I have not seen any docs and the API does not describes it very well.. Thanks Emmanuel From lists at ruby-forum.com Sun Jun 8 06:45:47 2008 From: lists at ruby-forum.com (Bacdh Do hai) Date: Sun, 8 Jun 2008 12:45:47 +0200 Subject: [Mongrel] Mongrel install crash on win32 In-Reply-To: <78de7f038919ce30d788674eee2c3bea@ruby-forum.com> References: <78de7f038919ce30d788674eee2c3bea@ruby-forum.com> Message-ID: <2c7ed35f32900ce44ed1e18db4508d63@ruby-forum.com> > C:\>gem install mongrel when you install mongrel in win32, you need : C:\>gem install mongrel_service because, in win32 support mongrel in service to run webserver. And then just run mongrel_rails to see what services -- Posted via http://www.ruby-forum.com/. From hongli at plan99.net Tue Jun 10 19:25:41 2008 From: hongli at plan99.net (Hongli Lai) Date: Wed, 11 Jun 2008 01:25:41 +0200 Subject: [Mongrel] Why not ignore stale PID files? Message-ID: <484F0D75.6090605@plan99.net> Zed A. Shaw wrote: > That would be the ideal situation, but Ruby doesn't have good enough > process management APIs to do this portably. Erik Hetzner: > ... but not the edge case where a process is running, with > the same owner, but is no longer a mongrel process. I feel obligated to reply. :) PID files suck. I think it's really stupid that modern operating systems don't provide some kind of mechanism to automatically delete a file when a process exits (even when it exits abnormally). Anyway, I've written a fair share of daemons in the past. What I tend to do is to combine PID files with a number of lock files: - foo.pid. This is obviously the PID file. - foo.lock. This is a lock file whose lock is acquired during the life time of the daemon. If the daemon exits, whether normally or abnormally, the lock on that file is released. To check whether foo.pid is stale, we simply check whether foo.lock is locked. The only way to check whether foo.lock is locked, is to lock it with the non-blocking parameter. If locking fails then it means it's already locked, meaning that the PID file is not stale. However, this could result in a racing condition. Suppose that you are starting a daemon, while simultaneously checking whether the daemon is already started: 1. The checker acquires a non-blocking lock on foo.lock. This succeeds, so it knows that the PID file is stale. It prints "stale PID file detected" on screen, and is about to release the lock on foo.lock. 2. All of a sudden, before the lock is released, a context switch occurs. The daemon that is being started tries to acquire a lock on foo.lock. This fails because the checker still has the lock, so the daemon thinks that there's already a daemon running, and exits. So we need another lock file to serialize all PID file related actions: - foo.global.lock So the code for checking whether the daemon's running is something like this: def check(): lock(foo.global.lock) if try_lock(foo.lock): # Locking succeeded, so we have a stale PID file here. unlock(foo.lock) unlock(foo.global.lock) return nil else: # Locking failed. Process is still running. pid = read_pid_file(foo.pid) # Of course, your code should also check whether the PID file actually exist. unlock(foo.global.lock) return pid Daemon code: lock(foo.global.lock) write_pid_file(foo.pid) lock(foo.lock) unlock(foo.global.lock) main_loop() lock(foo.global.lock) delete_file(foo.pid) unlock(foo.lock) unlock(foo.global.lock) NOTE: lock() creates the lock file if it doesn't already exist. This works great, even on Windows. The only gotchas are: - flock() doesn't work over NFS. You'll have to use some kind of fcntl() call to lock files over NFS, but I'm not sure whether Ruby provides an API for that. - foo.global.lock is never deleted. You cannot safely delete it without creating some kind of racing condition. From hongli at plan99.net Tue Jun 10 19:28:42 2008 From: hongli at plan99.net (Hongli Lai) Date: Wed, 11 Jun 2008 01:28:42 +0200 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: <484F0D75.6090605@plan99.net> References: <484F0D75.6090605@plan99.net> Message-ID: <484F0E2A.7050006@plan99.net> Hongli Lai wrote: > This works great, even on Windows. The only gotchas are: > - flock() doesn't work over NFS. You'll have to use some kind of fcntl() > call to lock files over NFS, but I'm not sure whether Ruby provides an > API for that. > - foo.global.lock is never deleted. You cannot safely delete it without > creating some kind of racing condition. I forgot to mention that it is safe to delete foo.lock. So the shutdown part of the daemon code should look like this: lock(foo.global.lock) delete_file(foo.pid) unlock(foo.lock) delete_file(foo.lock) # added this line unlock(foo.global.lock) From jos at catnook.com Tue Jun 10 19:50:39 2008 From: jos at catnook.com (Jos Backus) Date: Tue, 10 Jun 2008 16:50:39 -0700 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: <484F0D75.6090605@plan99.net> References: <484F0D75.6090605@plan99.net> Message-ID: <20080610235039.GA26060@lizzy.catnook.local> On Wed, Jun 11, 2008 at 01:25:41AM +0200, Hongli Lai wrote: > PID files suck. Agreed. Just use daemontools or runit or some other process manager - no pidfiles or complicated locking code needed. -- Jos Backus jos at catnook.com From swindsor at gmail.com Tue Jun 10 21:24:58 2008 From: swindsor at gmail.com (Scott Windsor) Date: Tue, 10 Jun 2008 18:24:58 -0700 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: <20080610235039.GA26060@lizzy.catnook.local> References: <484F0D75.6090605@plan99.net> <20080610235039.GA26060@lizzy.catnook.local> Message-ID: Has anyone considering turning the mongrel_cluster into a process manager daemon? I know that generally many people rely on other applications (such as monit) to ensure that mongrels are up and running, but it seems that integrated process management out of the box would be a large win. The mongrel_cluster could remain running (rather than exiting) and keep track of the running mongrels (potentially restarting them if they die or zombie). At that point, pid files become uneeded for tracking running mongrels. The only exception would be if the mongrel cluster itself dies - at this point it would orphan the child processes and it would up to the cluster to kill off (or resume ownership) of any orphaned processes. thoughts? - scott On Tue, Jun 10, 2008 at 4:50 PM, Jos Backus wrote: > On Wed, Jun 11, 2008 at 01:25:41AM +0200, Hongli Lai wrote: > > PID files suck. > > Agreed. Just use daemontools or runit or some other process manager - no > pidfiles or complicated locking code needed. > > -- > Jos Backus > jos at catnook.com > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jos at catnook.com Tue Jun 10 21:42:30 2008 From: jos at catnook.com (Jos Backus) Date: Tue, 10 Jun 2008 18:42:30 -0700 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: References: <484F0D75.6090605@plan99.net> <20080610235039.GA26060@lizzy.catnook.local> Message-ID: <20080611014230.GA27724@lizzy.catnook.local> On Tue, Jun 10, 2008 at 06:24:58PM -0700, Scott Windsor wrote: > Has anyone considering turning the mongrel_cluster into a process manager > daemon? I'm not using this myself (I use standalone daemontools) but mongrel_runit should fit the bill at least somewhat: https://wiki.hjksolutions.com/display/MR/Home -- Jos Backus jos at catnook.com From seatmanu at gmail.com Wed Jun 11 14:18:55 2008 From: seatmanu at gmail.com (Emmanuel Pinault) Date: Wed, 11 Jun 2008 11:18:55 -0700 Subject: [Mongrel] mongrel multipart HTTP response (not request) Message-ID: Hi, Is this possible to send a Multipart response on Mongrel ? How would I do that in the handler? Thanks Emmanuel From zedshaw at zedshaw.com Wed Jun 11 16:23:10 2008 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 11 Jun 2008 16:23:10 -0400 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: <20080610235039.GA26060@lizzy.catnook.local> References: <484F0D75.6090605@plan99.net> <20080610235039.GA26060@lizzy.catnook.local> Message-ID: <20080611162310.881f8b9b.zedshaw@zedshaw.com> On Tue, 10 Jun 2008 16:50:39 -0700 Jos Backus wrote: > On Wed, Jun 11, 2008 at 01:25:41AM +0200, Hongli Lai wrote: > > PID files suck. > > Agreed. Just use daemontools or runit or some other process manager - no > pidfiles or complicated locking code needed. You ever read the code to runit? I wouldn't touch that thing with a 10' pole. Haven't used daemontools though. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From jos at catnook.com Wed Jun 11 19:47:27 2008 From: jos at catnook.com (Jos Backus) Date: Wed, 11 Jun 2008 16:47:27 -0700 Subject: [Mongrel] Why not ignore stale PID files? In-Reply-To: <20080611162310.881f8b9b.zedshaw@zedshaw.com> References: <484F0D75.6090605@plan99.net> <20080610235039.GA26060@lizzy.catnook.local> <20080611162310.881f8b9b.zedshaw@zedshaw.com> Message-ID: <20080611234727.GA13287@lizzy.catnook.local> On Wed, Jun 11, 2008 at 04:23:10PM -0400, Zed A. Shaw wrote: > You ever read the code to runit? I wouldn't touch that thing with a > 10' pole. Haven't used daemontools though. Haven't looked at runit code, no. Daemontools so far has worked great for me for over a decade. -- Jos Backus jos at catnook.com From lists at ruby-forum.com Thu Jun 12 01:52:59 2008 From: lists at ruby-forum.com (Roger Pack) Date: Thu, 12 Jun 2008 07:52:59 +0200 Subject: [Mongrel] mongrel and fastthread on ruby 1.9? In-Reply-To: <71166b3b0711181409r223fee58o6a69b43a26245738@mail.gmail.com> References: <71166b3b0711180956u4576248bu9ec5c88ce0a94dbf@mail.gmail.com> <71166b3b0711181409r223fee58o6a69b43a26245738@mail.gmail.com> Message-ID: > But anyway, you need to manually build and install mongrel from source > since the gem dependency will remain there. > > Hmn, second thought: maybe we could remove the "official" dependency > on fastthread and evaluate if the ruby version you're using is fixed? > > In the same idea of cgi-eof-fix > (long-name-of-gem-to-be-easily-remembered). 'twould indeed be a nice convenience to have a mongrel gem that built on ruby 1.9 :) These days even checking it out from trunk yields errors. -R -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Jun 12 02:02:20 2008 From: lists at ruby-forum.com (Roger Pack) Date: Thu, 12 Jun 2008 08:02:20 +0200 Subject: [Mongrel] mongrel and fastthread on ruby 1.9? In-Reply-To: References: <71166b3b0711180956u4576248bu9ec5c88ce0a94dbf@mail.gmail.com> <71166b3b0711181409r223fee58o6a69b43a26245738@mail.gmail.com> Message-ID: <2fcabe17bee3f0dede38b73d71bb52f5@ruby-forum.com> > These days even checking it out from trunk yields errors. > -R Anybody seen anything like this before? /Users/rogerpack/dev/ruby_19_installed/lib/ruby/site_ruby/1.9.0/mongrel/handlers.rb:214: warning: else without rescue is useless SyntaxError: /Users/rogerpack/dev/ruby_19_installed/lib/ruby/site_ruby/1.9.0/mongrel/handlers.rb:208: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' ...te(modified_since) rescue nil : false ... ^ /Users/rogerpack/dev/ruby_19_installed/lib/ruby/site_ruby/1.9.0/mongrel/handlers.rb:209: syntax error, unexpected ':', expecting keyword_end ... : false with 1.9? -R -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Jun 12 09:45:20 2008 From: lists at ruby-forum.com (Roger Pack) Date: Thu, 12 Jun 2008 15:45:20 +0200 Subject: [Mongrel] mongrel and fastthread on ruby 1.9? In-Reply-To: <2fcabe17bee3f0dede38b73d71bb52f5@ruby-forum.com> References: <71166b3b0711180956u4576248bu9ec5c88ce0a94dbf@mail.gmail.com> <71166b3b0711181409r223fee58o6a69b43a26245738@mail.gmail.com> <2fcabe17bee3f0dede38b73d71bb52f5@ruby-forum.com> Message-ID: <21963a9ffc539f05d396013ea9c9072c@ruby-forum.com> > SyntaxError: > /Users/rogerpack/dev/ruby_19_installed/lib/ruby/site_ruby/1.9.0/mongrel/handlers.rb:208: > syntax error, unexpected ':', expecting keyword_then or ',' or ';' or > '\n' replacing those colons with 'then' seems to at least let it pass the syntax checker. Now if I can just get merb and hpricot to work on 1.9... Thanks! -R -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Jun 12 10:58:28 2008 From: lists at ruby-forum.com (Sankar Ganesh) Date: Thu, 12 Jun 2008 16:58:28 +0200 Subject: [Mongrel] mongrel_rails cluster::stop not working Message-ID: <05e318561b3dc617b7e8cab6d20d40e7@ruby-forum.com> Hi am a newbie to mongrel. am using mongrel cluster in my ruby application. When i start mongrel cluster it is working fine and when i stop it it says already stopped port 8000. it is giving the error as follows ********* simple selection ********* ********* selection by list ********* -A all processes -C by command name -N negate selection -G by real group ID (supports names) -a all w/ tty except session leaders -U by real user ID (supports names) -d all except session leaders -g by session leader OR by group name -e all processes -p by process ID T all processes on this terminal -s processes in the sessions given a all w/ tty, including other users -t by tty g all, even group leaders! -u by effective user ID (supports names) r only running processes U processes for specified users x processes w/o controlling ttys t by tty *********** output format ********** *********** long options *********** -o,o user-defined -f full --Group --User --pid --cols -j,j job control s signal --group --user --sid --rows -O,O preloaded -o v virtual memory --cumulative --format --deselect -l,l long u user-oriented --sort --tty --forest --version X registers --heading --no-heading ********* misc options ********* -V,V show version L list format codes f ASCII art forest -m,m show threads S children in sum -y change -l format -n,N set namelist file c true command name n numeric WCHAN,UID -w,w wide output e show environment -H process heirarchy already stopped port 8001 it is not taking the process ids from the pid file. Please help me to solve this problem -- Posted via http://www.ruby-forum.com/. From rochkind at jhu.edu Thu Jun 12 11:05:56 2008 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Thu, 12 Jun 2008 11:05:56 -0400 Subject: [Mongrel] mongrel_rails cluster::stop not working In-Reply-To: <05e318561b3dc617b7e8cab6d20d40e7@ruby-forum.com> References: <05e318561b3dc617b7e8cab6d20d40e7@ruby-forum.com> Message-ID: <48513B54.1050403@jhu.edu> When "mongrel_rails cluster::start" is run but does NOT actually succesfully start up your mongrels, it doesn't neccesarily give you any error messages. Is what I have noticed. I have had cluster::start fail but not give me any error messages. So if cluster::stop is telling you "already stopped", I think that means that you never succesfully started it in the first place, you just didn't realize it. So now the real question is, Why didn't it succesfully start in the first place, and how do you figure that out? That's the trick, I'm not sure. Jonathan Sankar Ganesh wrote: > Hi > > am a newbie to mongrel. am using mongrel cluster in my ruby application. > > When i start mongrel cluster it is working fine and when i stop it it > says already stopped port 8000. > > it is giving the error as follows > > ********* simple selection ********* ********* selection by list > ********* > -A all processes -C by command name > -N negate selection -G by real group ID (supports > names) > -a all w/ tty except session leaders -U by real user ID (supports > names) > -d all except session leaders -g by session leader OR by group > name > -e all processes -p by process ID > T all processes on this terminal -s processes in the sessions given > a all w/ tty, including other users -t by tty > g all, even group leaders! -u by effective user ID (supports > names) > r only running processes U processes for specified users > x processes w/o controlling ttys t by tty > *********** output format ********** *********** long options > *********** > -o,o user-defined -f full --Group --User --pid --cols > -j,j job control s signal --group --user --sid --rows > -O,O preloaded -o v virtual memory --cumulative --format --deselect > -l,l long u user-oriented --sort --tty --forest --version > X registers --heading --no-heading > ********* misc options ********* > -V,V show version L list format codes f ASCII art forest > -m,m show threads S children in sum -y change -l format > -n,N set namelist file c true command name n numeric WCHAN,UID > -w,w wide output e show environment -H process heirarchy > already stopped port 8001 > > > it is not taking the process ids from the pid file. > > Please help me to solve this problem > -- Jonathan Rochkind Digital Services Software Engineer The Sheridan Libraries Johns Hopkins University 410.516.8886 rochkind (at) jhu.edu From lists at ruby-forum.com Thu Jun 12 16:37:35 2008 From: lists at ruby-forum.com (David Bell) Date: Thu, 12 Jun 2008 22:37:35 +0200 Subject: [Mongrel] Mongrel won't start ... mongrel_rails (MissingSourceFile) Message-ID: Hi All, I'm a newbie and I'm soooo confused at the moment! Here's my setup: 1) I've installed Ruby 1.8 on an Ubuntu 7.10 platform. I used apt to install that. 2) I downloaded rubygems_1.1.1 and installed that (tar -xzf, then ruby setup.rb) 3) I installed rails (gem install rails --include-dependencies) 4) I installed mongrel (gem install mongrel --include-dependencies) 5) I created a test dir (cd; rails mytest) 6) I tried to start mongrel (cd mytest; ruby script/server) I get a load error: => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails 2.1.0 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Exiting /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load': no such file to load -- mongrel_rails (MissingSourceFile) NOTE: I can start mongrel using /usr/bin/mongrel_rails and I get no errors. I put a puts $: statement at the end of config/boot.rb and indeed, the path to the mongrel gem is missing. What's up? Where/how do I fix this? Thanks in advance. -- David -- Posted via http://www.ruby-forum.com/. From zedshaw at zedshaw.com Fri Jun 13 05:36:49 2008 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Fri, 13 Jun 2008 05:36:49 -0400 Subject: [Mongrel] Mongrel won't start ... mongrel_rails (MissingSourceFile) In-Reply-To: References: Message-ID: <20080613053649.92541ee6.zedshaw@zedshaw.com> On Thu, 12 Jun 2008 22:37:35 +0200 David Bell wrote: > => Booting Mongrel (use 'script/server webrick' to force WEBrick) > => Rails 2.1.0 application starting on http://0.0.0.0:3000 > => Call with -d to detach > => Ctrl-C to shutdown server > Exiting > /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in > `load': no such file to load -- mongrel_rails (MissingSourceFile) Hmm, no idea since I don't use Debian, but did you possibly install it wrong or maybe install via ruby gems rather than apt-get? I'm not sure, but if it's debian they probably mess with the package layout so you kind of are stuck using their package manager. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From lists at ruby-forum.com Fri Jun 13 18:06:58 2008 From: lists at ruby-forum.com (David Bell) Date: Sat, 14 Jun 2008 00:06:58 +0200 Subject: [Mongrel] Mongrel won't start ... mongrel_rails (MissingSourceFile In-Reply-To: References: Message-ID: Problem solved... I had, at some previous time, loaded mongrel using apt. I uninstalled it (using apt) but the /usr/local/lib/site_ruby mongrel files were still there. The require statement picked up the site_ruby version instead of the /usr/lib/ruby/gems version. As soon as I renamed the files in /usr/local/lib/site_ruby, things started working. -- DB -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Jun 14 03:45:51 2008 From: lists at ruby-forum.com (Sankar Ganesh) Date: Sat, 14 Jun 2008 09:45:51 +0200 Subject: [Mongrel] mongrel_rails cluster::stop not working In-Reply-To: <48513B54.1050403@jhu.edu> References: <05e318561b3dc617b7e8cab6d20d40e7@ruby-forum.com> <48513B54.1050403@jhu.edu> Message-ID: Jonathan Rochkind wrote: > When "mongrel_rails cluster::start" is run but does NOT actually > succesfully start up your mongrels, it doesn't neccesarily give you any > error messages. Is what I have noticed. I have had cluster::start fail > but not give me any error messages. > > So if cluster::stop is telling you "already stopped", I think that means > that you never succesfully started it in the first place, you just > didn't realize it. > > So now the real question is, Why didn't it succesfully start in the > first place, and how do you figure that out? That's the trick, I'm not > sure. > > Jonathan how to find out the errors? but it is not showing any error when it is starting. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Jun 16 05:47:23 2008 From: lists at ruby-forum.com (Guido Holz) Date: Mon, 16 Jun 2008 11:47:23 +0200 Subject: [Mongrel] Apache rewrites with mongrel Message-ID: <9545edf2c073e37bbd26363f9ab44dd2@ruby-forum.com> I?m knew to rewrites on apache in combination with mongrelcluster. It?s urgend for me, because the server has an loadaverage about 10 :-((((( Ok so I?m using 3 mongrel-server on an mongrelcluster. The Loadbalancer ist apache I think, that my rewrites are not correct. Please can anybody check my rewrites ? That?s in my /etc/apache2/conf.d/rails.proxy_cluster.conf BalancerMember http://127.0.0.1:4712 BalancerMember http://127.0.0.1:4713 BalancerMember http://127.0.0.1:4714 that?s in my /etc/apache2/sites-enabled/000-rails RewriteEngine On # Deflate AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE !no-gzip !gzip-only-text/html ProxyPass /images ! ProxyPass /stylesheets ! ProxyPass /javascripts ! Alias /images /var/www/rails/myApp/current/public/images Alias /stylesheets /var/www/rails/myApp/current/public/stylesheets Alias /javascripts /var/www/rails/myApp/current/public/javascripts RewriteLog /var/log/apache2/rails-rewrite.log And last not lease my .htaccess in public AddHandler fastcgi-script .fcgi AddHandler cgi-script .cgi Options +FollowSymLinks +ExecCGI AddDefaultCharset UTF-8 RewriteEngine On RewriteRule ^01,([0-9]*).html$ balancer://mongrel_cluster/shop/event/$1 [P,QSA,L] RewriteRule ^01,([a-zA-Z0-9]*),([0-9]+).html$ balancer://mongrel_cluster/shop/search/$2?startnumber=$1 [P,L] RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.cgi [QSA,L] the rewrite for static-sites is correct? I saw this lines on a howto RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] if I call www.myApp.com/shop (redirected internaly by globalize to en/shop ) then I`ll get the cached page under public/en/shop.html but when I call www.myApp.com/shop again then I can see in my logfiles Processing ShopController#index (for xx.xxx.xxx.xx at 2008-06-16 11:46:04) [GET] Session ID: 4cbe53c829bdc7ef9ceb81cc6f0fe1fa Parameters: {"action"=>"index", "controller"=>"shop", "locale"=>"en"} Rendering template within layouts/shop Rendering shop/index Completed in 0.17766 (5 reqs/sec) | Rendering: 0.09954 (56%) | DB: 0.00000 (0%) | 200 OK [http://www.myApp.com/en/shop/] I think something went wrong with my rewrites. thanks for helping. cheers guido -- Posted via http://www.ruby-forum.com/. From neongrau at gmail.com Mon Jun 16 06:06:08 2008 From: neongrau at gmail.com (Ralf Vitasek) Date: Mon, 16 Jun 2008 12:06:08 +0200 Subject: [Mongrel] Apache rewrites with mongrel In-Reply-To: <9545edf2c073e37bbd26363f9ab44dd2@ruby-forum.com> References: <9545edf2c073e37bbd26363f9ab44dd2@ruby-forum.com> Message-ID: <7045DCD4-D945-4C22-87A1-292542D0C760@gmail.com> why do you need rewrites at all? just point your document root to the rails public dir and these ProxyPass settings should be enough ProxyPass /images ! ProxyPass /stylesheets ! ProxyPass /javascripts ! ProxyPass / balancer://mongrelcluster/ ProxyPassReverse / balancer://mongrelcluster/ -- Freundliche Gr??e, Ralf Vitasek o L_ OL This is Sch?uble. Copy Sch?uble into your signature to help him on his way to ?berwachungsstaat Am 16.06.2008 um 11:47 schrieb Guido Holz: > > I?m knew to rewrites on apache in combination with mongrelcluster. > It?s urgend for me, because the server has an loadaverage about 10 > :-((((( > > Ok so I?m using 3 mongrel-server on an mongrelcluster. The > Loadbalancer > ist apache > I think, that my rewrites are not correct. Please can anybody check my > rewrites ? > > > That?s in my /etc/apache2/conf.d/rails.proxy_cluster.conf > > BalancerMember http://127.0.0.1:4712 > BalancerMember http://127.0.0.1:4713 > BalancerMember http://127.0.0.1:4714 > > > that?s in my /etc/apache2/sites-enabled/000-rails > > RewriteEngine On > > # Deflate > AddOutputFilterByType DEFLATE text/html text/plain text/css > text/xml > BrowserMatch ^Mozilla/4 gzip-only-text/html > BrowserMatch ^Mozilla/4.0[678] no-gzip > BrowserMatch bMSIE !no-gzip !gzip-only-text/html > > ProxyPass /images ! > ProxyPass /stylesheets ! > ProxyPass /javascripts ! > > Alias /images /var/www/rails/myApp/current/public/images > Alias /stylesheets > /var/www/rails/myApp/current/public/stylesheets > Alias /javascripts > /var/www/rails/myApp/current/public/javascripts > > RewriteLog /var/log/apache2/rails-rewrite.log > > > And last not lease my .htaccess in public > > AddHandler fastcgi-script .fcgi > AddHandler cgi-script .cgi > Options +FollowSymLinks +ExecCGI > > AddDefaultCharset UTF-8 > RewriteEngine On > > RewriteRule ^01,([0-9]*).html$ balancer://mongrel_cluster/shop/event/ > $1 > [P,QSA,L] > RewriteRule ^01,([a-zA-Z0-9]*),([0-9]+).html$ > balancer://mongrel_cluster/shop/search/$2?startnumber=$1 [P,L] > > RewriteRule ^$ index.html [QSA] > RewriteRule ^([^.]+)$ $1.html [QSA] > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule ^(.*)$ dispatch.cgi [QSA,L] > > > the rewrite for static-sites is correct? > I saw this lines on a howto > > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f > RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] > > > if I call www.myApp.com/shop (redirected internaly by globalize to > en/shop ) > then I`ll get the cached page under public/en/shop.html > > but when I call www.myApp.com/shop again then I can see in my logfiles > > Processing ShopController#index (for xx.xxx.xxx.xx at 2008-06-16 > 11:46:04) [GET] > Session ID: 4cbe53c829bdc7ef9ceb81cc6f0fe1fa > Parameters: {"action"=>"index", "controller"=>"shop", "locale"=>"en"} > Rendering template within layouts/shop > Rendering shop/index > Completed in 0.17766 (5 reqs/sec) | Rendering: 0.09954 (56%) | DB: > 0.00000 (0%) | 200 OK [http://www.myApp.com/en/shop/] > > I think something went wrong with my rewrites. > > > thanks for helping. > > cheers guido > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From lists at ruby-forum.com Mon Jun 16 06:27:14 2008 From: lists at ruby-forum.com (Guido Holz) Date: Mon, 16 Jun 2008 12:27:14 +0200 Subject: [Mongrel] Apache rewrites with mongrel In-Reply-To: <7045DCD4-D945-4C22-87A1-292542D0C760@gmail.com> References: <9545edf2c073e37bbd26363f9ab44dd2@ruby-forum.com> <7045DCD4-D945-4C22-87A1-292542D0C760@gmail.com> Message-ID: uff... I saw this on an turorial.. but something went wrong.. know I have no time to cahnge and try out what?s right :-( So what handles the cached static-html-sites on your proxypasses?!? is this realy enough? another question is the difference between RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.cgi [QSA,L] and RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] do I need the first or the second one?!? thanks guido neongrau __ wrote: > why do you need rewrites at all? > > just point your document root to the rails public dir > and these ProxyPass settings should be enough > > ProxyPass /images ! > ProxyPass /stylesheets ! > ProxyPass /javascripts ! > ProxyPass / balancer://mongrelcluster/ > ProxyPassReverse / balancer://mongrelcluster/ > > > > -- > Freundliche > Gr??e,Ralf Vitasek > > > o > L_ > OL > > This is Sch?uble. > Copy Sch?uble into your signature > to help him on his way to ?berwachungsstaat > > > > > Am 16.06.2008 um 11:47 schrieb Guido Holz: -- Posted via http://www.ruby-forum.com/. From neongrau at gmail.com Mon Jun 16 07:00:39 2008 From: neongrau at gmail.com (Ralf Vitasek) Date: Mon, 16 Jun 2008 13:00:39 +0200 Subject: [Mongrel] Apache rewrites with mongrel In-Reply-To: References: <9545edf2c073e37bbd26363f9ab44dd2@ruby-forum.com> <7045DCD4-D945-4C22-87A1-292542D0C760@gmail.com> Message-ID: the dispatch.cgi thing was meant for fastcgi setups without mongels, but noone is using that anymore. i don't think you need any rewrites at all. by pointing the document root to the public dir and the ProxyPass that end with "!" will make apache serve them statically without bothering your mongrels. everything else will then be directed to the cluster. here is an example container i'm using this is with windows authentication utilizing an active directory domain and injecting the authenticated user into the headers for further use within my app controller assets like images / stylesheets and javascripts get served directly and are also memcached and all text content getting gzip compressed which saves about 70% of traffic ServerName someserver.domain.de DocumentRoot "C:/rails/public/" ErrorLog "C:/rails/log/balancer_error.log" CacheEnable mem /images CacheEnable mem /stylesheets CacheEnable mem /javascripts CacheEnable mem /latest/images MCacheSize 64000000 MCacheMaxObjectCount 10000 MCacheMinObjectSize 1 MCacheMaxObjectSize 20480 AddOutputFilterByType DEFLATE text/html text/plain text/xml text/ css application/json text/json application/xml application/xhtml+xml text/javascript application/javascript application/x-javascript ProxyRequests Off ProxyVia On ProxyPreserveHost On ProxyPass /balancer ! ProxyPass /images ! ProxyPass /stylesheets ! ProxyPass /javascripts ! ProxyPass / balancer://mongrelcluster/ ProxyPassReverse / balancer://mongrelcluster/ AuthName "Windows Authentication" AuthType SSPI SSPIAuth On SSPIAuthoritative On SSPIOfferSSPI On SSPIOfferBasic On SSPIBasicPreferred On SSPIPerRequestAuth On SSPIDomain somedomain Require valid-user RewriteEngine On RewriteCond %{REMOTE_USER} (.+) RewriteRule . - [E=RU:%1] RequestHeader set REMOTE_USER %{RU}e BalancerMember http://127.0.0.1:3101 BalancerMember http://127.0.0.1:3102 BalancerMember http://127.0.0.1:3103 BalancerMember http://127.0.0.1:3104 BalancerMember http://127.0.0.1:3105 BalancerMember http://127.0.0.1:3106 SetHandler balancer-manager AuthName "Windows Authentication for Balancer" AuthType SSPI SSPIAuth on SSPIOfferSSPI on SSPIOfferBasic off SSPIBasicPreferred On SSPIUsernameCase lower SSPIDomain somedomain Require group "somedomain\domain admins" -- Freundliche Gr??e, Ralf Vitasek o L_ OL This is Sch?uble. Copy Sch?uble into your signature to help him on his way to ?berwachungsstaat Am 16.06.2008 um 12:27 schrieb Guido Holz: > uff... I saw this on an turorial.. but something went wrong.. know I > have no time to cahnge and try out what?s right :-( > > So what handles the cached static-html-sites on your proxypasses?!? is > this realy enough? > > another question is the difference between > > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule ^(.*)$ dispatch.cgi [QSA,L] > > and > > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f > RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] > > > do I need the first or the second one?!? > > thanks guido > > neongrau __ wrote: >> why do you need rewrites at all? >> >> just point your document root to the rails public dir >> and these ProxyPass settings should be enough >> >> ProxyPass /images ! >> ProxyPass /stylesheets ! >> ProxyPass /javascripts ! >> ProxyPass / balancer://mongrelcluster/ >> ProxyPassReverse / balancer://mongrelcluster/ >> >> >> >> -- >> Freundliche >> Gr??e,Ralf Vitasek >> >> >> o >> L_ >> OL >> >> This is Sch?uble. >> Copy Sch?uble into your signature >> to help him on his way to ?berwachungsstaat >> >> >> >> >> Am 16.06.2008 um 11:47 schrieb Guido Holz: > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From gtendai at beckman.com Mon Jun 16 07:01:22 2008 From: gtendai at beckman.com (gtendai at beckman.com) Date: Mon, 16 Jun 2008 04:01:22 -0700 Subject: [Mongrel] Geza Tendai/NB/BII is out of the office. Message-ID: I will be out of the office starting 06/16/2008 and will not return until 06/28/2008. I will respond to your message when I return. The server made the following annotations --------------------------------------------------------------------------------- This message contains information that may be privileged or confidential and is the property of Beckman Coulter, Inc. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. --------------------------------------------------------------------------------- From seatmanu at gmail.com Mon Jun 16 14:57:55 2008 From: seatmanu at gmail.com (Emmanuel Pinault) Date: Mon, 16 Jun 2008 11:57:55 -0700 Subject: [Mongrel] Mongrel Access log? Message-ID: I see the module RequestLog::Access in the API but how do I use it/ turn on the log to see access log for mongrel? can someone help me out with it? Thanks Emmanuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Jun 17 02:35:31 2008 From: lists at ruby-forum.com (George Schreiber) Date: Tue, 17 Jun 2008 08:35:31 +0200 Subject: [Mongrel] x_send_file sends a 1 byte file Message-ID: <77d077739fbe20e9d8eb435d6a91b339@ruby-forum.com> Hello, sorry if creating a dupe... I'm trying to download files to authenticated users in my app. I've set up x_send_file. All seems to be correct to me, however when I try to download any file, I get a 1-byte long file downloaded. I am getting this already in development - so no Apache, no lighthttpd, just a mongrel_rails start in the root of my app. Any help/hint would be appreciated. Thanks, George -- Posted via http://www.ruby-forum.com/. From jeremy at bitsweat.net Tue Jun 17 03:23:09 2008 From: jeremy at bitsweat.net (Jeremy Kemper) Date: Tue, 17 Jun 2008 00:23:09 -0700 Subject: [Mongrel] x_send_file sends a 1 byte file In-Reply-To: <77d077739fbe20e9d8eb435d6a91b339@ruby-forum.com> References: <77d077739fbe20e9d8eb435d6a91b339@ruby-forum.com> Message-ID: <69a2885c0806170023h1bd52ea8xd4e7b8d5cc43d9fb@mail.gmail.com> On Mon, Jun 16, 2008 at 11:35 PM, George Schreiber wrote: > Hello, > > sorry if creating a dupe... > > I'm trying to download files to authenticated users in my app. I've set > up x_send_file. All seems to be correct to me, however when I try to > download any file, I get a 1-byte long file downloaded. > > I am getting this already in development - so no Apache, no lighthttpd, > just a mongrel_rails start in the root of my app. > > Any help/hint would be appreciated. This only works with a frontend httpd to intercept the X-Sendfile response header and send the actual file. Without a frontend httpd, you're seeing the expected result. Use firebug to verify. jeremy From wyhaines at gmail.com Tue Jun 17 12:32:39 2008 From: wyhaines at gmail.com (Kirk Haines) Date: Tue, 17 Jun 2008 10:32:39 -0600 Subject: [Mongrel] x_send_file sends a 1 byte file In-Reply-To: <69a2885c0806170023h1bd52ea8xd4e7b8d5cc43d9fb@mail.gmail.com> References: <77d077739fbe20e9d8eb435d6a91b339@ruby-forum.com> <69a2885c0806170023h1bd52ea8xd4e7b8d5cc43d9fb@mail.gmail.com> Message-ID: On Tue, Jun 17, 2008 at 1:23 AM, Jeremy Kemper wrote: > On Mon, Jun 16, 2008 at 11:35 PM, George Schreiber wrote: >> Hello, >> >> sorry if creating a dupe... >> >> I'm trying to download files to authenticated users in my app. I've set >> up x_send_file. All seems to be correct to me, however when I try to >> download any file, I get a 1-byte long file downloaded. > > This only works with a frontend httpd to intercept the X-Sendfile > response header and send the actual file. > > Without a frontend httpd, you're seeing the expected result. Use > firebug to verify. To expand on what Jeremy said, x_send_file just sets an HTTP header, X-Sendfile, in the response. It's up to whatever is running in front of your processes to see that header and then to do something with it. So, in order to adequately test it, you will have to have _something_ in front of your processes which handle it. Also be aware that only some web servers implement X-Sendfile (Apache, via mod_xsendfile, lighttpd natively [it originated with them], and Swiftiply are the three that come to mind). Litespeed has their own redirect syntax (which they spin to make it sound better than the others). Nginx also has it's own approach with x-accel-redirect (which Swiftiply may support in the future, as well). So if you are using any one of those mechanisms for delivering static file downloads, to test it you will have to have a compatible front end running, and without some (fairly minor) code changes, you are locked into whatever one you choose to use. Hope this helps. Kirk Haines From matte at ruckuswireless.com Tue Jun 17 13:37:01 2008 From: matte at ruckuswireless.com (Matte Edens) Date: Tue, 17 Jun 2008 10:37:01 -0700 Subject: [Mongrel] x_send_file sends a 1 byte file In-Reply-To: References: <77d077739fbe20e9d8eb435d6a91b339@ruby-forum.com> <69a2885c0806170023h1bd52ea8xd4e7b8d5cc43d9fb@mail.gmail.com> Message-ID: <4857F63D.1050101@ruckuswireless.com> If you do have X-SendFile installed make sure your settings for it are correct as well. I got caught by this the other day too. I had forgotten to add... |XSendFile on XSendFileAllowAbove on |||to my VirtualHost config. FYI. matte - webmaster webmaster at ruckuswireless.com || Kirk Haines wrote: > On Tue, Jun 17, 2008 at 1:23 AM, Jeremy Kemper wrote: > >> On Mon, Jun 16, 2008 at 11:35 PM, George Schreiber wrote: >> >>> Hello, >>> >>> sorry if creating a dupe... >>> >>> I'm trying to download files to authenticated users in my app. I've set >>> up x_send_file. All seems to be correct to me, however when I try to >>> download any file, I get a 1-byte long file downloaded. >>> >> This only works with a frontend httpd to intercept the X-Sendfile >> response header and send the actual file. >> >> Without a frontend httpd, you're seeing the expected result. Use >> firebug to verify. >> > > To expand on what Jeremy said, x_send_file just sets an HTTP header, > X-Sendfile, in the response. > > It's up to whatever is running in front of your processes to see that > header and then to do something with it. > > So, in order to adequately test it, you will have to have _something_ > in front of your processes which handle it. Also be aware that only > some web servers implement X-Sendfile (Apache, via mod_xsendfile, > lighttpd natively [it originated with them], and Swiftiply are the > three that come to mind). Litespeed has their own redirect syntax > (which they spin to make it sound better than the others). Nginx also > has it's own approach with x-accel-redirect (which Swiftiply may > support in the future, as well). > > So if you are using any one of those mechanisms for delivering static > file downloads, to test it you will have to have a compatible front > end running, and without some (fairly minor) code changes, you are > locked into whatever one you choose to use. > > Hope this helps. > > > Kirk Haines > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcr at simtone.net Tue Jun 17 15:39:26 2008 From: mcr at simtone.net (mcr at simtone.net) Date: Tue, 17 Jun 2008 15:39:26 -0400 Subject: [Mongrel] x_send_file sends a 1 byte file In-Reply-To: References: <77d077739fbe20e9d8eb435d6a91b339@ruby-forum.com> <69a2885c0806170023h1bd52ea8xd4e7b8d5cc43d9fb@mail.gmail.com> Message-ID: <20080617194610.00B2218581BB@rubyforge.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 >>>>> "Kirk" == Kirk Haines writes: Kirk> So, in order to adequately test it, you will have to have Kirk> _something_ in front of your processes which handle it. Also Kirk> be aware that only some web servers implement X-Sendfile Good point. I have some scripts that setup apache.conf to run in the current directory, as current user, on a high-port. It would be all rake tasks, but my rake task actually just invokes a Makefile and shell scripts, because I wrote this code for a non-ruby project originally. (My makefile also arranges to build a mysql cluster locally too) I would like to have system level tests of some kind to help with this kind of thing too. I haven't looked at how the mongrel code itself gets tested --- maybe there is something there that can help? - -- Michael Richardson Director -- Consumer Desktop Development, Simtone Corporation, Ottawa, Canada Personal: http://www.sandelman.ca/mcr/ SIMtone Corporation fundamentally transforms computing into simple, secure, and very low-cost network-provisioned services pervasively accessible by everyone. Learn more at www.simtone.net and www.SIMtoneVDU.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQDVAwUBSFgS7e0sRu40D6vCAQI4ogYAoJkW4C7P7acV+ZRoCU6Bb46Wt3M6qwzG 0SUWXzs2xvGPFmcpdqjBIIHj/D+XCNZxIPgFtj62yFmZTzl320sJvjcrA/SOteRD o4ik+wXHFmIKum3Yz4i2qSJFNJmZJ4Juv7p9Np1b6M0W3Gjz4IbKox1oteCicnTW e18hgZg5009LxjPxwNXnKVZbJQmdqGM3xB2MMK3eBOkN5HkbwaBConrhOZ3VpmU1 PlTVjdt4mZ2RPXtrzDMG6ROJqhaYbmka =Fyfj -----END PGP SIGNATURE----- From lists at ruby-forum.com Wed Jun 18 01:41:10 2008 From: lists at ruby-forum.com (George Schreiber) Date: Wed, 18 Jun 2008 07:41:10 +0200 Subject: [Mongrel] x_send_file sends a 1 byte file In-Reply-To: <69a2885c0806170023h1bd52ea8xd4e7b8d5cc43d9fb@mail.gmail.com> References: <77d077739fbe20e9d8eb435d6a91b339@ruby-forum.com> <69a2885c0806170023h1bd52ea8xd4e7b8d5cc43d9fb@mail.gmail.com> Message-ID: Jeremy Kemper wrote: > On Mon, Jun 16, 2008 at 11:35 PM, George Schreiber > wrote: >> >> Any help/hint would be appreciated. > > This only works with a frontend httpd to intercept the X-Sendfile > response header and send the actual file. > > Without a frontend httpd, you're seeing the expected result. Use > firebug to verify. Thanks Jeremy; - as the filename is correct - as I have used breakpoints in x_send_file and investigated the headers it sets I think you are right, I am seeing the expected and correct results. Also, thank you all of you guys; I will go and play with Apache (2.2) -- the chosen front-end -- to see it downloading the complete file. Best regards, George -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Jun 22 01:27:29 2008 From: lists at ruby-forum.com (Sean Six) Date: Sun, 22 Jun 2008 07:27:29 +0200 Subject: [Mongrel] Working offline Message-ID: <55e22a67b0f202aa1c29eefbb8f185ab@ruby-forum.com> I noticed that the server will not work when I am disconnected to the internet. Should this always be the case? -- Posted via http://www.ruby-forum.com/. From m.fellinger at gmail.com Sun Jun 22 19:38:19 2008 From: m.fellinger at gmail.com (Michael Fellinger) Date: Mon, 23 Jun 2008 08:38:19 +0900 Subject: [Mongrel] Working offline In-Reply-To: <55e22a67b0f202aa1c29eefbb8f185ab@ruby-forum.com> References: <55e22a67b0f202aa1c29eefbb8f185ab@ruby-forum.com> Message-ID: <9c00d3e00806221638o3f46cdf5ve878b2c95801ac56@mail.gmail.com> On Sun, Jun 22, 2008 at 2:27 PM, Sean Six wrote: > I noticed that the server will not work when I am disconnected to the > internet. Should this always be the case? Make sure your loopback adapter is active, or you won't be able to access localhost. Either that, or describe "will not work" a bit more :) ^ manveru From dave at opensecurityfoundation.org Mon Jun 23 09:59:45 2008 From: dave at opensecurityfoundation.org (David Shettler) Date: Mon, 23 Jun 2008 09:59:45 -0400 Subject: [Mongrel] patched ruby seems to break mongrel? Message-ID: <26fc42fe0806230659w51c05afao1a2250c09d92947c@mail.gmail.com> Hey all, patched ruby on my development and production environments to 1.8.6-p230 to address these new ruby vulnerabilities: http://www.ruby-lang.org/en/news/2008/06/20/arbitrary-code-execution-vulnerabilities/ mongrel began segfaulting after restarting. Then tried ruby 1.8.7-p22 and upgrading to rails 2.1.0 (from rails 2.0.2), same issue. Had to revert back to the vulnerable GA 1.8.6. Running centos 4, mongrel 1.1.5 (tried 1.1.3, 1.1.4 as well, all same results). Any further info I can provide, I'd be glad to. Dave OSVDB.org From luislavena at gmail.com Mon Jun 23 10:15:25 2008 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 23 Jun 2008 16:15:25 +0200 Subject: [Mongrel] patched ruby seems to break mongrel? In-Reply-To: <26fc42fe0806230659w51c05afao1a2250c09d92947c@mail.gmail.com> References: <26fc42fe0806230659w51c05afao1a2250c09d92947c@mail.gmail.com> Message-ID: <71166b3b0806230715t5d43d66dy7b688566b4ecb03b@mail.gmail.com> On Mon, Jun 23, 2008 at 3:59 PM, David Shettler wrote: > Hey all, patched ruby on my development and production environments > to 1.8.6-p230 to address these new ruby vulnerabilities: > > http://www.ruby-lang.org/en/news/2008/06/20/arbitrary-code-execution-vulnerabilities/ > I still think