Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 268222 - dev-db/couchdb 0.9 initscript hardcodes "beam"
Summary: dev-db/couchdb 0.9 initscript hardcodes "beam"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Caleb Tennis (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-01 23:40 UTC by Joshua Bronson
Modified: 2009-07-10 15:56 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Bronson 2009-05-01 23:40:14 UTC
The couchdb 0.9 initscript passes "--name beam" to start-stop-daemon, however if erlang was emerged with the smp use flag, beam's process name will actually be "beam.smp" and so using the initscript to start couchdb will fail.
Comment 1 Kenneth Kalmer 2009-05-08 11:26:02 UTC
(In reply to comment #0)
> The couchdb 0.9 initscript passes "--name beam" to start-stop-daemon, however
> if erlang was emerged with the smp use flag, beam's process name will actually
> be "beam.smp" and so using the initscript to start couchdb will fail.
> 

I can confirm this is an issue, and the proposed solution fixes it. I'll try and see if I can get the ebuild patched.
Comment 2 Caleb Tennis (RETIRED) gentoo-dev 2009-05-08 15:48:27 UTC
I'm happy to fix, but I don't know what the proposed fix is.
Comment 3 Joshua Bronson 2009-05-14 01:33:20 UTC
the initscript could replace references to the "beam" literal with the variable $BEAM, which it sets by asking equery for erlang's USE flags ("equery uses dev-lang/erlang"). it'd be nice if there were a way to ask equery about only the one particular USE flag we care about, but it doesn't look like there is. if not, something like this works:

if [ `equery uses dev-lang/erlang | grep smp` = "+smp" ]; then
  BEAM="beam.smp"
else
  BEAM="beam"
fi
Comment 4 Caleb Tennis (RETIRED) gentoo-dev 2009-06-21 15:39:34 UTC
I've updated the 0.9 ebuild's conf.d and init.d scripts to handle this instance, I believe.  Let me know if you see an issue, and reopen.
Comment 5 Joshua Bronson 2009-07-10 15:23:37 UTC
I've just emerged couchdb 0.9.0 and noticed line 11 of /etc/conf.d/couchdb:

    if [ -e /usr/lib*/erlang/erts-*/bin/beam.smp ]; then

This is broken. Did you try it on the command line first? The double glob appears to be the culprit:

~ $ [ -e /usr/lib64/erlang/erts-*/bin/beam.smp ]
~ $ echo $?
0
~ $ [ -e /usr/lib*/erlang/erts-*/bin/beam.smp ]
-bash: [: /usr/lib/erlang/erts-5.7.1/bin/beam.smp: binary operator expected
Comment 6 Caleb Tennis (RETIRED) gentoo-dev 2009-07-10 15:56:59 UTC
I tested, but I guess not appropriately.

I just committed a fix using sed instead.