I wanted to be able to specify in my /etc/rc.conf file whether mongrel_cluster should be enabled and the mongrel_cluster_config file for the init script, so I wrote this simple rc.d style script. Just throw it in /usr/local/etc/rc.d/ and do a chmod +x /usr/local/etc/rc.d/mongrel_cluster.sh To enable the script, add mongrel_cluster_enable="YES" to /etc/rc.conf and optionally add mongrel_cluster_config="/etc/mongrel_cluster" The default config path is /usr/local/etc/mongrel_cluster Would be nice if mongrel_cluster_ctl had some sort of "status" switch to see if the servers are actually running and what their pids are. Andrew Bennett potatosaladx at gmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: mongrel_cluster.sh Type: application/x-sh Size: 936 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20060728/9a5a9a41/attachment.sh
Andrew, This is pretty cool. will give it a run and see let you know. Sunder On 7/28/06, Andrew Bennett <potatosaladx at gmail.com> wrote:> > I wanted to be able to specify in my /etc/rc.conf file whether > mongrel_cluster should be enabled and the mongrel_cluster_config file > for the init script, so I wrote this simple rc.d style script. > > Just throw it in /usr/local/etc/rc.d/ and do a chmod +x > /usr/local/etc/rc.d/mongrel_cluster.sh > > To enable the script, add mongrel_cluster_enable="YES" to /etc/rc.conf > and optionally add mongrel_cluster_config="/etc/mongrel_cluster" > > The default config path is /usr/local/etc/mongrel_cluster > > Would be nice if mongrel_cluster_ctl had some sort of "status" switch > to see if the servers are actually running and what their pids are. > > Andrew Bennett > potatosaladx at gmail.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: http://rubyforge.org/pipermail/mongrel-users/attachments/20060728/4480e34c/attachment.html
Hi Andrew: On Jul 28, 2006, at 4:04 PM, Andrew Bennett wrote:> I wanted to be able to specify in my /etc/rc.conf file whether > mongrel_cluster should be enabled and the mongrel_cluster_config file > for the init script, so I wrote this simple rc.d style script.That''s awesome. Thanks! I''ll include it in the next prerelease.> > Would be nice if mongrel_cluster_ctl had some sort of "status" switch > to see if the servers are actually running and what their pids are.I''ll look into this. Thanks, Bradley Taylor ------ Rails Optimized Hosting ~ VPS and Dedicated Servers Simplified Deployment ~ Services and Software http://railsmachine.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060728/fb3af45a/attachment.html
Hey Bradley, On Jul 28, 2006, at 4:57 PM, Bradley Taylor wrote:> > > > Would be nice if mongrel_cluster_ctl had some sort of "status" switch > > to see if the servers are actually running and what their pids are. > > I''ll look into this.I made a simple patch that displays the pids and port numbers of all the running mongrel clusters based on the pid files that exist. Not sure if that''s the best way to do that, but it gets the job done. I use mongrel on a (FreeBSD) server at my work and I needed a way of automating the clusters and checking on their existance. It should work on both Linux and FreeBSD or anything that uses pid files (ie. not Windows). I also updated the rc.d script to include the status ability. Hope this helps. Andrew Bennett potatosaladx at gmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: mongrel_cluster-0.2.0+status.patch.diff Type: application/octet-stream Size: 4176 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20060729/fc1b26a1/attachment-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: mongrel_cluster.sh Type: application/x-sh Size: 1036 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20060729/fc1b26a1/attachment-0001.sh
Hey there, Thanks for the script. I use FreeBSD too so this is really useful. I''m not much of a shell script person though. What would I have to change in order to manage more than one clusters? (so that they all can start on boot). Thanks, -carl On Jul 29, 2006, at 3:54 PM, Andrew Bennett wrote:> Hey Bradley, > > On Jul 28, 2006, at 4:57 PM, Bradley Taylor wrote: >> > >> > Would be nice if mongrel_cluster_ctl had some sort of "status" >> switch >> > to see if the servers are actually running and what their pids are. >> >> I''ll look into this. > > I made a simple patch that displays the pids and port numbers of all > the running mongrel clusters based on the pid files that exist. Not > sure if that''s the best way to do that, but it gets the job done. > > I use mongrel on a (FreeBSD) server at my work and I needed a way of > automating the clusters and checking on their existance. It should > work on both Linux and FreeBSD or anything that uses pid files (ie. > not Windows). > > I also updated the rc.d script to include the status ability. > > Hope this helps. > > Andrew Bennett > potatosaladx at gmail.com > <mongrel_cluster-0.2.0+status.patch.diff> > <mongrel_cluster.sh> > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users
Hey Carl, On 8/7/06, Carl Lerche <carl.lerche at verizon.net> wrote:> Thanks for the script. I use FreeBSD too so this is really useful. > I''m not much of a shell script person though. What would I have to > change in order to manage more than one clusters? (so that they all > can start on boot).Here''s how I have things set up: Create a directory at /usr/local/etc/mongrel_cluster and link your mongrel configuration files under there (I''m including the commands for reference, not to insult your intelligence): user$ sudo mkdir /usr/local/etc/mongrel_cluster user$ sudo ln -svf /home/rails/blog/config/mongrel_cluster.yml /usr/local/etc/mongrel_cluster/blog.yml user$ sudo ln -svf /home/rails/shop/config/mongrel_cluster.yml /usr/local/etc/mongrel_cluster/shop.yml Move my script to /usr/local/etc/rc.d/ and set permissions: user$ sudo mv mongrel_cluster.sh /usr/local/etc/rc.d/ user$ sudo chmod 755 /usr/local/etc/rc.d/mongrel_cluster.sh Add mongrel_cluster to /etc/rc.conf to run at startup: user$ sudo vim /etc/rc.conf (Add mongrel_cluster_enable="YES" where you want it to start up in the order of things. Optionally add mongrel_cluster_config="..." if you decided to have your mongrel_cluster configuration in a differnet location.) Now start the clusters: user$ sudo /usr/local/etc/rc.d/mongrel_cluster.sh start And it should always startup on boot now. If you apply my patch, you can run things like: user$ sudo /usr/local/etc/rc.d/mongrel_cluster.sh status ...to see if your clusters are running, what ports they are running on, and what their process identifier (pid) numbers are. Lemme know if you have any problems or questions, I hope this helps. Andrew Bennett potatosaladx at gmail.com
Jamie Orchard-Hays
2006-Nov-10 00:22 UTC
[Mongrel] mongrel_cluster rc.d script for FreeBSD
I followed the instructions for this. I can start with mongrel_cluster_ctl no problem, but on reboot, the mongrel servers are not starting. I''m running user/group as www It wouldn''t start when trying to write the pid files to /var/run, so I''m writing to the app''s log dir. Nothing is written to the mongrel log on reboot, so it doesn''t seem to be doing anything. tail gives: ** TERM signal received. ** TERM signal received. ** TERM signal received. for the last three lines from system restart. rc.conf: mongrel_cluster_enable="YES" mongrel_cluster_config="/usr/local/etc/mongrel_cluster" conf file is nlx.yml FreeBSD 6.1 Rails edge latest prerelease mongrel latest mongrel_cluster Looking for ideas. Thanks, Jamie On Jul 28, 2006, at 4:04 PM, Andrew Bennett wrote:> I wanted to be able to specify in my /etc/rc.conf file whether > mongrel_cluster should be enabled and the mongrel_cluster_config file > for the init script, so I wrote this simple rc.d style script. > > Just throw it in /usr/local/etc/rc.d/ and do a chmod +x > /usr/local/etc/rc.d/mongrel_cluster.sh > > To enable the script, add mongrel_cluster_enable="YES" to /etc/rc.conf > and optionally add mongrel_cluster_config="/etc/mongrel_cluster" > > The default config path is /usr/local/etc/mongrel_cluster > > Would be nice if mongrel_cluster_ctl had some sort of "status" switch > to see if the servers are actually running and what their pids are. > > Andrew Bennett > potatosaladx at gmail.com > <mongrel_cluster.sh> > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users
I had this same problem. Use monit to manage your mongrels (http://www.tildeslash.com/monit/) Vish On 11/10/06, Jamie Orchard-Hays <jamie at dangosaur.us> wrote:> I followed the instructions for this. I can start with > mongrel_cluster_ctl no problem, but on reboot, the mongrel servers > are not starting. > > I''m running user/group as www > It wouldn''t start when trying to write the pid files to /var/run, so > I''m writing to the app''s log dir. > Nothing is written to the mongrel log on reboot, so it doesn''t seem > to be doing anything. tail gives: > ** TERM signal received. > ** TERM signal received. > ** TERM signal received. > > for the last three lines from system restart. > > rc.conf: > mongrel_cluster_enable="YES" > mongrel_cluster_config="/usr/local/etc/mongrel_cluster" > > conf file is > nlx.yml > > FreeBSD 6.1 > Rails edge > latest prerelease mongrel > latest mongrel_cluster > > Looking for ideas. > > Thanks, > Jamie > > On Jul 28, 2006, at 4:04 PM, Andrew Bennett wrote: > > > I wanted to be able to specify in my /etc/rc.conf file whether > > mongrel_cluster should be enabled and the mongrel_cluster_config file > > for the init script, so I wrote this simple rc.d style script. > > > > Just throw it in /usr/local/etc/rc.d/ and do a chmod +x > > /usr/local/etc/rc.d/mongrel_cluster.sh > > > > To enable the script, add mongrel_cluster_enable="YES" to /etc/rc.conf > > and optionally add mongrel_cluster_config="/etc/mongrel_cluster" > > > > The default config path is /usr/local/etc/mongrel_cluster > > > > Would be nice if mongrel_cluster_ctl had some sort of "status" switch > > to see if the servers are actually running and what their pids are. > > > > Andrew Bennett > > potatosaladx at gmail.com > > <mongrel_cluster.sh> > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >