mongrel_cluster is a key element in setting up a rails app cluster that is load balanced via apache (2.2 with mod_proxy_balancer). It can be set up as a init.d system service. files forthcoming: - ebuild - conf.d file - init.d file
Created attachment 93662 [details] dev-ruby/mongrel_cluster-0.2.0.ebuild ebuild for mongrel_cluster
Created attachment 93663 [details] ${FILESDIR}/mongrel_cluster.conf conf.d file for mongrel_cluster
Created attachment 93664 [details] ${FILESDIR}/mongrel_cluster.init init.d file for mongrel_cluster
added bug dependency information
Created attachment 93665 [details] dev-ruby/mongrel_cluster-0.2.0.ebuild (updated) I added a dodir /etc/mongrel_cluster -- otherwise the init.d script fails.
Merge my ebuild in this version. Patch for mongrel_cluster_ctl : add a verbose option and a soft restart (reload). Depend and reload in init script (restart is auto).
Created attachment 98848 [details] dev-ruby/mongrel_cluster-0.2.0.ebuild (updated)
Comment on attachment 98848 [details] dev-ruby/mongrel_cluster-0.2.0.ebuild (updated) ebuild with patch for
Created attachment 98849 [details] mongrel_cluster_ctl.patch patch for mongrel_cluster_ctl
Created attachment 98850 [details] ${FILESDIR}/mongrel_cluster.init init script with Depend and Reload
Created attachment 99346 [details] dev-ruby/mongrel_cluster-0.2.0.ebuild (updated) Work with package install (--usepkg option)
This one should really belong to www-servers as there is nothing "ruby development" in it. www-servers, would you mind if I put this package into www-servers category? BTW, there is no "Ruby License" license, it should be "Ruby" (I can fix it myself so no patch is needed)
Forgot to CC www-servers. www-servers please see comment #12
Although I can use mongrel_cluster via mongrel_rails. I don't know how to use its initscript. Any example, Yann?
init script: CONF_DIR=/etc/mongrel_cluster depend() { need net } start() { ebegin "Starting mongrel clusters" mongrel_cluster_ctl start -c $CONF_DIR eend $? "Failed to start nginx" } stop() { ebegin "Stopping mongrel clusters" mongrel_cluster_ctl stop -c $CONF_DIR eend $? "failed to stop clusters" } Then in /etc/mongrel_cluster you just put soft links to the mongrel.yml config files of your various rails apps.
(In reply to comment #15) [snip] > Then in /etc/mongrel_cluster you just put soft links to the mongrel.yml config > files of your various rails apps. Didn't work for me: * Service mongrel_cluster starting !!! Path to log file not valid: log/mongrel.log mongrel::start reported an error. Use mongrel_rails mongrel::start -h to get help. !!! Path to log file not valid: log/mongrel.log mongrel::start reported an error. Use mongrel_rails mongrel::start -h to get help. * Service mongrel_cluster started Worse, the service got started even if mongel_cluster_ctl failed. BTW, I used initscript from this bug but the result shouldn't be too different with your initscript.
Hmm, never said it was 100% robust :): here's one of my yml files, if it's helpful: --- user: mongrel cwd: /var/www/fuel.aei-tech.com/ port: "8000" environment: production group: mongrel address: 0.0.0.0 pid_file: log/mongrel.pid servers: 2
The dependency needs to be changed from dev-ruby/mongrel to www-servers/mongrel. Since mongrel is in portage now could this be added to?
BTW I'm getting this during emerge ("mv cannot stat" error). But emerge finishes fine. .... >>> Install mongrel_cluster-0.2.0 into /var/tmp/portage/mongrel_cluster-0.2.0/image/ category www-servers Attempting local installation of '/var/tmp/portage/mongrel_cluster-0.2.0/distdir/mongrel_cluster-0.2.0' Successfully installed mongrel_cluster, version 0.2.0 * Applying mongrel_cluster_ctl.patch ... [ ok ] >>> Completed installing mongrel_cluster-0.2.0 into /var/tmp/portage/mongrel_cluster-0.2.0/image/ mv: cannot stat `/var/tmp/portage/mongrel_cluster-0.2.0/image///usr/lib64/ruby/site_ruby/1.8/*': No such file or directory set +o allexport set -o braceexpand set +o emacs set +o errexit set +o errtrace set +o functrace set -o hashall set +o histexpand set +o history set +o ignoreeof set -o interactive-comments set +o keyword set +o monitor set +o noclobber set +o noexec set -o noglob set +o nolog set +o notify set +o nounset set +o onecmd set +o physical set +o pipefail set +o posix set +o privileged set +o verbose set +o vi set +o xtrace /usr/portage/eclass/ruby.eclass: line 241: set: +g: invalid option set: usage: set [--abefhkmnptuvxBCHP] [-o option] [arg ...] man: >>> Merging www-servers/mongrel_cluster-0.2.0 to / --- /usr/ --- /usr/lib64/ ....
Created attachment 106372 [details] mongrel_cluster-0.2.1.ebuild The ebuild I used for 0.2.1 is a little different from yours. Here is the diff --- /home/pclouds/Desktop/mongrel_cluster-0.2.0.ebuild 2007-01-10 22:03:42.000000000 +0700 +++ mongrel_cluster-0.2.1.ebuild 2007-01-04 20:05:58.000000000 +0700 @@ -4,27 +4,23 @@ inherit ruby gems -MY_P="mongrel_cluster-${PV}" DESCRIPTION="Mongrel plugin that provides commands and Capistrano tasks for managing multiple Mongrel processes" HOMEPAGE="http://mongrel.rubyforge.org/docs/mongrel_cluster.html" -SRC_URI="http://gems.rubyforge.org/gems/${MY_P}.gem" +SRC_URI="http://mongrel.rubyforge.org/releases/gems/${P}.gem" -LICENSE="Ruby License" +LICENSE="Ruby" SLOT="0" KEYWORDS="~x86" IUSE="" USE_RUBY="any" -DEPEND="virtual/ruby - dev-ruby/mongrel" - -S=${WORKDIR}/${MY_P} +DEPEND="www-servers/mongrel" src_install() { gems_src_install - EPATCH_OPTS="-d ${D}/${GEMSDIR}/gems/$MY_P" + EPATCH_OPTS="-d ${D}/${GEMSDIR}/gems/${P}" epatch ${FILESDIR}/mongrel_cluster_ctl.patch dodir /etc/mongrel_cluster
Created attachment 106388 [details] mongrel_cluster_ctl.patch error Got a new error. I attached the file Successfully installed mongrel_cluster, version 0.2.1 * Applying mongrel_cluster_ctl.patch ... * Failed Patch: mongrel_cluster_ctl.patch ! * ( /usr/local/portage/www-servers/mongrel_cluster/files/mongrel_cluster_ctl.patch ) * * Include in your bugreport the contents of: * * /var/tmp/portage/mongrel_cluster-0.2.1/temp/mongrel_cluster_ctl.patch-4209.out
Created attachment 106390 [details, diff] mongrel_cluster/files/mongrel_cluster_ctl.patch Yes the patch also needs to be updated
Thanks. I can report that it's working for me. amd64
Any chance of getting this commited to portage? Working fine for me. Also mongrel_cluster-0.2.2.gem is out.
FYI, I added 0.2.2 without initscripts
Why no initscripts, may I ask? It is the documented/preferred way to use mongrel_cluster in an on-server situation.
(In reply to comment #26) > Why no initscripts, may I ask? It is the documented/preferred way to use > mongrel_cluster in an on-server situation. > Please see comment #16. If you are willing to fix initscripts, I'll be happy to add them
Created attachment 109118 [details] mongrel_cluster-0.2.2 init script init script for mongrel-0.2.2. Requires the conf.d file too. Working fine in my production system fyi, reload has been removed in mongrel_cluster 0.2.2
Please add ~amd64 keyword. all dependencies have it and it works fine on amd64
I vote for adding ~amd64, it works for me too. But without init scripts it actually does not make much sense. I am going to use this in production env. so I will try to make them and post here.
Oops, i missed the comment #28, I will test it.
I use the init scripts I originally posted when I made this bug in a production environment (x86) and use them in development mode frequently (amd64). I've never seen the issues people reported using them.
*mongrel_cluster-0.2.2 (03 Feb 2007) 03 Feb 2007; Nguy<E1><BB><85>n Th<C3><A1>i Ng<E1><BB><8D>c Duy <pclouds@gentoo .org> +mongrel_cluster-0.2.2.ebuild: Initial version, #143098 This was added a while ago, so closing. Please file separate bugs for keywords or the init script.