Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 143098 - new ebuild: dev-ruby/mongrel_cluster-0.2.0
Summary: new ebuild: dev-ruby/mongrel_cluster-0.2.0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Nguyen Thai Ngoc Duy (RETIRED)
URL:
Whiteboard:
Keywords: EBUILD
Depends on: 126925 142805
Blocks:
  Show dependency tree
 
Reported: 2006-08-07 08:43 UTC by Armando Di Cianno
Modified: 2007-06-05 03:45 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-ruby/mongrel_cluster-0.2.0.ebuild (mongrel_cluster-0.2.0.ebuild,631 bytes, text/plain)
2006-08-07 08:43 UTC, Armando Di Cianno
Details
${FILESDIR}/mongrel_cluster.conf (mongrel_cluster.conf,464 bytes, text/plain)
2006-08-07 08:44 UTC, Armando Di Cianno
Details
${FILESDIR}/mongrel_cluster.init (mongrel_cluster.init,503 bytes, text/plain)
2006-08-07 08:44 UTC, Armando Di Cianno
Details
dev-ruby/mongrel_cluster-0.2.0.ebuild (updated) (mongrel_cluster-0.2.0.ebuild,659 bytes, text/plain)
2006-08-07 08:48 UTC, Armando Di Cianno
Details
dev-ruby/mongrel_cluster-0.2.0.ebuild (updated) (mongrel_cluster-0.2.0.ebuild,852 bytes, text/plain)
2006-10-05 09:01 UTC, Yann Lugrin
Details
mongrel_cluster_ctl.patch (mongrel_cluster_ctl.patch,1.99 KB, text/plain)
2006-10-05 09:03 UTC, Yann Lugrin
Details
${FILESDIR}/mongrel_cluster.init (mongrel_cluster.init,633 bytes, text/plain)
2006-10-05 09:04 UTC, Yann Lugrin
Details
dev-ruby/mongrel_cluster-0.2.0.ebuild (updated) (mongrel_cluster-0.2.0.ebuild,820 bytes, text/plain)
2006-10-11 00:20 UTC, Yann Lugrin
Details
mongrel_cluster-0.2.1.ebuild (mongrel_cluster-0.2.1.ebuild,751 bytes, text/plain)
2007-01-10 15:07 UTC, Nguyen Thai Ngoc Duy (RETIRED)
Details
mongrel_cluster_ctl.patch error (mongrel_cluster_ctl.patch-4209.out,3.25 KB, text/plain)
2007-01-10 16:26 UTC, Tomislav Filipcic
Details
mongrel_cluster/files/mongrel_cluster_ctl.patch (mongrel_cluster_ctl.patch,2.03 KB, patch)
2007-01-10 16:37 UTC, Nguyen Thai Ngoc Duy (RETIRED)
Details | Diff
mongrel_cluster-0.2.2 init script (mongrel_cluster,518 bytes, text/plain)
2007-02-04 13:10 UTC, Tomislav Filipcic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Armando Di Cianno 2006-08-07 08:43:01 UTC
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
Comment 1 Armando Di Cianno 2006-08-07 08:43:40 UTC
Created attachment 93662 [details]
dev-ruby/mongrel_cluster-0.2.0.ebuild

ebuild for mongrel_cluster
Comment 2 Armando Di Cianno 2006-08-07 08:44:19 UTC
Created attachment 93663 [details]
${FILESDIR}/mongrel_cluster.conf

conf.d file for mongrel_cluster
Comment 3 Armando Di Cianno 2006-08-07 08:44:51 UTC
Created attachment 93664 [details]
${FILESDIR}/mongrel_cluster.init

init.d file for mongrel_cluster
Comment 4 Armando Di Cianno 2006-08-07 08:45:40 UTC
added bug dependency information
Comment 5 Armando Di Cianno 2006-08-07 08:48:48 UTC
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.
Comment 6 Yann Lugrin 2006-10-05 09:00:35 UTC
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).
Comment 7 Yann Lugrin 2006-10-05 09:01:37 UTC
Created attachment 98848 [details]
dev-ruby/mongrel_cluster-0.2.0.ebuild (updated)
Comment 8 Yann Lugrin 2006-10-05 09:02:24 UTC
Comment on attachment 98848 [details]
dev-ruby/mongrel_cluster-0.2.0.ebuild (updated)

ebuild with patch for
Comment 9 Yann Lugrin 2006-10-05 09:03:24 UTC
Created attachment 98849 [details]
mongrel_cluster_ctl.patch

patch for mongrel_cluster_ctl
Comment 10 Yann Lugrin 2006-10-05 09:04:02 UTC
Created attachment 98850 [details]
${FILESDIR}/mongrel_cluster.init

init script with Depend and Reload
Comment 11 Yann Lugrin 2006-10-11 00:20:37 UTC
Created attachment 99346 [details]
dev-ruby/mongrel_cluster-0.2.0.ebuild (updated)

Work with package install (--usepkg option)
Comment 12 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2006-12-29 20:15:55 UTC
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)
Comment 13 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2006-12-29 20:25:47 UTC
Forgot to CC www-servers. www-servers please see comment #12
Comment 14 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2007-01-04 05:57:30 UTC
Although I can use mongrel_cluster via mongrel_rails. I don't know how to use its initscript. Any example, Yann?
Comment 15 Caleb Tennis (RETIRED) gentoo-dev 2007-01-04 06:05:15 UTC
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.
Comment 16 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2007-01-04 06:15:04 UTC
(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.

Comment 17 Caleb Tennis (RETIRED) gentoo-dev 2007-01-04 06:32:42 UTC
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
Comment 18 Tomislav Filipcic 2007-01-10 14:29:00 UTC
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?
Comment 19 Tomislav Filipcic 2007-01-10 14:33:28 UTC
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/
....
Comment 20 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2007-01-10 15:07:13 UTC
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
Comment 21 Tomislav Filipcic 2007-01-10 16:26:48 UTC
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
Comment 22 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2007-01-10 16:37:25 UTC
Created attachment 106390 [details, diff]
mongrel_cluster/files/mongrel_cluster_ctl.patch

Yes the patch also needs to be updated
Comment 23 Tomislav Filipcic 2007-01-10 17:28:14 UTC
Thanks. I can report that it's working for me. amd64
Comment 24 Tomislav Filipcic 2007-02-01 15:24:52 UTC
Any chance of getting this commited to portage? Working fine for me. Also mongrel_cluster-0.2.2.gem is out.
Comment 25 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2007-02-03 11:36:34 UTC
FYI, I added 0.2.2 without initscripts
Comment 26 Armando Di Cianno 2007-02-03 19:12:23 UTC
Why no initscripts, may I ask?  It is the documented/preferred way to use mongrel_cluster in an on-server situation.
Comment 27 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2007-02-04 03:07:10 UTC
(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
Comment 28 Tomislav Filipcic 2007-02-04 13:10:51 UTC
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
Comment 29 Tomislav Filipcic 2007-02-07 16:34:24 UTC
Please add ~amd64 keyword. all dependencies have it and it works fine on amd64
Comment 30 Láďa Durchánek 2007-05-16 07:19:34 UTC
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.
Comment 31 Láďa Durchánek 2007-05-16 07:22:10 UTC
Oops, i missed the comment #28, I will test it.
Comment 32 Armando Di Cianno 2007-05-16 16:23:01 UTC
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.
Comment 33 Josh Nichols (RETIRED) gentoo-dev 2007-06-05 03:45:20 UTC
*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.