Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

solr: add startup plist #32069

Closed
wants to merge 1 commit into from
Closed

solr: add startup plist #32069

wants to merge 1 commit into from

Conversation

arnested
Copy link
Contributor

@arnested arnested commented Sep 3, 2014

Added a plist startup like was previously done in solr36 at Homebrew/homebrew-versions#366.

Defaults to running Solr on port 8984 so it can run in parallel with solr36 which runs on port 8983.

@@ -18,6 +18,9 @@ def script; <<-EOS.undent
def install
libexec.install Dir["*"]
(bin+"solr").write script
(var+'logs'+name).mkpath
(etc+name).mkpath
(etc+name).install Dir[libexec+'example/multicore'] unless (etc+name+'multicore').exist?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the Dir[] or the exist? check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dir[] removed.

I need the exist? because the example files are installed to /usr/local/solr/multicore and are supposed to be changed by the user when adding new/configuring new cores. Configuration that should persist on upgrades.

@arnested
Copy link
Contributor Author

arnested commented Sep 7, 2014

Sorry for the delay (work, kids, ...)...

I addressed @MikeMcQuaid s comments and pushed a new version.

@arnested
Copy link
Contributor Author

arnested commented Sep 7, 2014

The test fails. It looks as if the test bot is unable to reach Github.


-Djetty.port=48983
EOS
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we slim these down a lot (perhaps entirely)? The longer they are the less likely any of them will be read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Removing the caveats entirely is because the best choice then, because there is really nothing interesting left then.

@arnested
Copy link
Contributor Author

I have been busy with work and family and haven't had much time to follow up on this pull request.

There has been a lot of comments and I possible and I got a bit confused along the way. So I have been reading a bit up on Homebrews inner details and spent some thinking about what I actually wanted to do and how best to do it.

Besides providing a plist for easier starting a Solr server I want to supply a multicore configuration that makes the Solr "just work" when launched via the plist. Obviously the user must be able to change that configuration and the changed configuration be left untouched by future upgrades and installs.

So I have ended up with adding a post_install that will copy the example configuration distributed with Solr into /usr/local/etc/solr/multicore.

I used to have some "unless" condition on the part about the configuration stuff and @MikeMcQuaid pointed out that it was unnecessary. Previous attempts of mine didn't work without the "unless" part but this approach with copying instead of moving (which was the wrong thing to do in the first place) works like a charm.

@arnested
Copy link
Contributor Author

The first test build failed because 4.9.0 was no longer downloadable - I've added a commit upgrading it to 4.10.0.

def post_install
# Copy the multicore example configuration into
# /usr/local/etc/solr/multicore as a configuration starting point.
cp_r libexec+"example/multicore", etc+name+"multicore"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, use etc.install here.

@MikeMcQuaid
Copy link
Member

This PR needs rebased on master.

@jacknagel
Copy link
Contributor

ping, can we get this rebased, please?

Added a plist startup like was previously done in
[solr36](https://github.com/Homebrew/homebrew-versions/commit/4fa8b9b3c8f37667f1d993a53a6b9da383d87179)
at Homebrew/homebrew-versions#366.
@arnested
Copy link
Contributor Author

Rebased. Sorry for the long the delay. The updated version of Solr made a lot of the stuff I tried to do in post_install redundant. So now this is just adding a plist.

@jacknagel jacknagel closed this in d3b069b Oct 13, 2014
@arnested arnested deleted the solr-plist branch February 20, 2015 09:23
@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants