From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Dec 9 15:56:49 2014 Return-Path: Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 935D2D34 for ; Tue, 9 Dec 2014 15:56:49 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 795DF7EF for ; Tue, 9 Dec 2014 15:56:49 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id sB9FunQm069482 for ; Tue, 9 Dec 2014 15:56:49 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 195827] New: Patch to textproc/apache-solr rc.d startup script to allow Solr to run on a given host and port (and as a given user) Date: Tue, 09 Dec 2014 15:56:49 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports Tree X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: paul@gromit.dlib.vt.edu X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-ports-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2014 15:56:49 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195827 Bug ID: 195827 Summary: Patch to textproc/apache-solr rc.d startup script to allow Solr to run on a given host and port (and as a given user) Product: Ports Tree Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: freebsd-ports-bugs@FreeBSD.org Reporter: paul@gromit.dlib.vt.edu CC: gaod@hychen.org CC: gaod@hychen.org Flags: maintainer-feedback?(gaod@hychen.org) The rc.d solr startup script for textproc/apache-solr currently only allows Solr to run as root and Solr itself will bind to all available interfaces when it runs. It is desirable to run network daemons so they will bind to a particular interface (e.g., to coexist better with Jails), and also to run as a particular user. To that end, I've modified the /usr/local/etc/rc.d/solr startup script so that Solr can at least be bound to a particular host and port. I've also almost achieved the latter aim of allowing Solr to be run as a non-root user. The only thing preventing the startup script being able to do this is that is needs to ensure the /usr/local/share/examples/apache-solr/solr-webapp directory is writable by the user under which Solr is to be run. (The solr-webapp directory is the one into which the bundled Jetty deploys Solr.) There are two other changes to the solr rc.d script that support being able to run Solr as an unprivileged user: specifying the location of the logs and pid file. (Both currently specify locations requiring root write access.) The changes in the patch below support the following rc.conf settings for the solr rc.d script: solr_host: IP address to bind to (defaults to 0.0.0.0, i.e., all interfaces) solr_port: port to bind to (defaults to 8983) solr_log: directory to store log files (defaults to /var/log) solr_pidfile: location of pidfile (defaults to /var/run/solr.pid) All the defaults default to the current behaviour of the port. If solr_user is set in /etc/rc.conf, and the solr-webapp exists and is writable by that user, then Solr will run successfully as $solr_user, assuming solr_log and solr_pidfile point to places writable by that user. Here is the patch to textproc/apache-solr: --- /usr/local/etc/rc.d/solr 2014-12-08 17:47:24.509744000 -0500 +++ solr 2014-12-09 10:34:32.154587847 -0500 @@ -38,13 +38,17 @@ : ${solr_enable:=NO} : ${solr_instance:=/var/db/solr} +: ${solr_pidfile:=/var/run/solr.pid} +: ${solr_log:=/var/log} +: ${solr_host:=0.0.0.0} +: ${solr_port:=8983} required_files=${solr_instance}/solr.xml -pidfile=/var/run/solr.pid +pidfile=${solr_pidfile} command=/usr/sbin/daemon procname=/usr/local/openjdk7/bin/java start_precmd="cd /usr/local/share/examples/apache-solr" -command_args="-f -p ${pidfile} ${procname} ${solr_flags} -Dsolr.solr.home=${solr_instance} -Dsolr.log=/var/log -jar /usr/local/share/examples/apache-solr/start.jar" +command_args="-f -p ${pidfile} ${procname} ${solr_flags} -Djetty.host=${solr_host} -Djetty.port=${solr_port} -Dsolr.solr.home=${solr_instance} -Dsolr.log=${solr_log} -jar /usr/local/share/examples/apache-solr/start.jar" run_rc_command "$1" --- Comment #1 from Bugzilla Automation --- Maintainer CC'd -- You are receiving this mail because: You are the assignee for the bug.