tracker issue : CF-3123145

select a category, or use search below
(searches all categories and all time range)
Title:

Solr Start Script on SELinux

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Cameron Jacobs / Cameron Jacobs (Cameron.Jacobs)

Created: 02/24/2012

Components: Installation/Config

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Public Beta / CF10_Update14

Priority/Frequency: Major / All users will encounter

Locale/System: English / Linux All

Vote Count: 6

Problem Description:
After installing ColdFusion 10, I attempted to start Solr and solr was unable to start.

Steps to Reproduce:
cd /opt/coldfusion10/cfusion/jetty
sudo ./cfsolr start

Actual Result:
CF Administrator under ColdFusion Collections is unable to connect to Solr.  Upon inspecting the log file: /opt/coldfusion10/cfusion/jetty/logs/start.log I noticed an error message:
/sbin/runuser: invalid option -- 'X'
Try `/sbin/runuser --help' for more information.

Any Workarounds:
Looking at the cfsolr start/stop script it appears that I'm running the following two lines:
SUCMD="/sbin/runuser -s /bin/sh $RUNTIME_USER -c"
SOLRSTART='cd $SOLR;$SUCMD $SOLR_JVM/bin/java $JVMARGS -jar start.jar >> $SOLR/logs/start.log 2>&1'

I expect that adding quotes around the -c script contained in the option would solve the problem, but I have not tested this.  It just appears that the runuser script is intercepting the -XX options from the JVMARGS variable

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3123145

External Customer Info:
External Company:  
External Customer Name: Cameron.Jacobs
External Customer Email:  
External Test Config: My Hardware and Environment details:

Fedora 10 x86_64

SELinux

Attachments:

  1. February 28, 2012 00:00:00: 1_cfsolr.txt
  2. February 28, 2012 00:00:00: 2_coldfusion.txt

Comments:

Hi Jacobs, Can you please share cfsolr file with me? Thanks Kunal CF Team
Comment by Kunal S.
20576 | February 26, 2012 11:56:43 PM GMT
Hello - As mentioned before, I have not updated these scripts, but the updates should be very simple. Description of the problem: I attached 2 files: cfsolr (start/stop script for solr service) and coldfusion (start/stop script for coldfusion). I had to add ".txt" as an extension or this system would not allow me to upload the attachments. If you look in "cfsolr", when this script runs for me to try and start solr, it processes the SOLRSTART variable created on line 113, where SUCMD is defined on 107. In short I'm using /sbin/runuser on Linux and I am running this script as root. In comparison, if you look at "coldfusion" the similar command's variable is defined on line 202 with the SUCMDFILE defined on line 200. In this case the -c option for /sbin/runuser is quoted and this allows it to run properly. I believe the solution should be: Line 113 in cfsolr: SOLRSTART='cd $SOLR;$SUCMD "$SOLR_JVM/bin/java $JVMARGS -jar start.jar" >> $SOLR/logs/start.log 2>&1' Please let me know if you need any additional information. Thanks, Cameron
Comment by External U.
20577 | February 27, 2012 12:20:22 PM GMT
I just attempted making the change that I suggested on my prior comment and this did not fix it. I still received the same error: /sbin/runuser: invalid option -- 'X'
Comment by External U.
20578 | February 27, 2012 06:31:53 PM GMT
I am not entirely sure why it didn't work. I just ran the exact line that should be running on the command line and it appears not to be throwing an error. I suppose it's a minor difference, but the script I ran after evaluating all of the variables was: cd /opt/coldfusion10/cfusion/jetty; /sbin/runuser -s /bin/sh apache -c "/opt/coldfusion10/jre/bin/java -XX:+AggressiveOpts -XX:+ScavengeBeforeFullGC -XX:-UseParallelGC -Xmx512m -Dsolr.solr.home=multicore -DSTOP.PORT=8077 -DSTOP.KEY=cfsolrstop -jar start.jar" >> /opt/coldfusion10/cfusion/jetty/logs/start.log 2>&1
Comment by External U.
20579 | February 27, 2012 06:40:05 PM GMT
Hi Jacobs, One more info, what OS you are using and is it 32 or 64 bit? Thanks Kunal
Comment by Kunal S.
20580 | February 29, 2012 03:28:17 AM GMT
Hello, I thought I put that up in the description, but I'm running Fedora 10 x86_64 with SELinux. So yes, it's 64-bit. Let me know if you need any additional information. Thanks, Cameron
Comment by External U.
20581 | February 29, 2012 12:13:12 PM GMT
Okay, not sure why this didn't get to you before, but adding the quotes to the runuser line DID solve the problem, so sounds like a very minor update.
Comment by External U.
20582 | March 30, 2012 05:27:36 PM GMT
Hi I had a similar experience with starting SOLR on RHEL 6 (64 bit) Here is a thread I created on the adobe forums http://forums.adobe.com/message/4741992#4741992
Comment by External U.
20583 | October 01, 2012 11:32:07 PM GMT
Also an issue in Ubuntu. Changed the same line: SOLRSTART='cd $SOLR;$SUCMD "$SOLR_JVM/bin/java $JVMARGS -jar start.jar" >> $SOLR/logs/start.log 2>&1' I put double quotes around the "$SOLR...start.jar"
Comment by External U.
20584 | December 07, 2012 03:21:35 PM GMT
come on adobe. please fix this!
Vote by External U.
20588 | November 19, 2013 08:55:16 PM GMT
Are you serious you 'Deferred' this because you don't have enough time ? Its 2 lines from an init script you need to fix up! AND...someone already posted the fix for you!
Comment by External U.
20585 | November 19, 2013 09:53:00 PM GMT
+1 PatBranley, I posted a fix about a year ago. It's such a simple thing to fix and has major implications for users who don't know about this bug. I probably wasted 10 hours of my life trying to figure this out last year. Solr doesn't start up automatically on Linux servers due to this bug!
Comment by External U.
20586 | November 20, 2013 02:30:28 PM GMT
Seriously? A customer gave you the bug year ago and you can't be bothered to try it out?
Vote by External U.
20589 | November 20, 2013 02:45:29 PM GMT
This bug will discourage people from using CF/Solr on Linux. It's a must fix in my opinion.
Vote by External U.
20590 | November 20, 2013 02:58:57 PM GMT
+1 The work around is published, just fix it.
Vote by External U.
20591 | November 20, 2013 03:25:01 PM GMT
We are just beginning to migrate our application searches to Solr and found very fustrating that this bug is still alive.
Vote by External U.
20592 | February 16, 2014 07:57:04 PM GMT
The command to start solr (from CF10 onwards) is : sudo ./cfjetty start You should now be able to start the solr using this command. Hence, closing this bug. (Comment added from ex-user id:prk)
Comment by Adobe D.
20587 | September 22, 2014 04:45:44 AM GMT
Guys, it's 2014 and my team just had this exact same issue on Ubuntu Linux took us 4 hours to find it!!!! The rest of the posts are right, not fixing this is very negligent when it's such an easy change! You simply put quotes around the start commands. Can you please update this? In lines 114 to 120 of /opt/coldfusion10/cfusion/jettty/cfjetty if [ $ID -eq 0 ]; then SOLRSTART='cd $SOLR;$SUCMD "$SOLR_JVM/bin/java $JVMARGS -jar start.jar" >> $SOLR/logs/start.log 2>&1' SOLRSTOP='cd $SOLR;$SUCMD "$SOLR_JVM/bin/java $JVMARGS -jar start.jar --stop" >> $SOLR/logs/start.log 2>&1' else SOLRSTART='cd $SOLR;$SUCMD "$SOLR_JVM/bin/java $JVMARGS -jar start.jar" >> $SOLR/logs/start.log 2>&1' SOLRSTOP='cd $SOLR;$SUCMD "$SOLR_JVM/bin/java $JVMARGS -jar start.jar --stop" >> $SOLR/logs/start.log 2>&1' fi
Vote by External U.
20593 | October 09, 2014 06:08:22 PM GMT