New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed Java dependency from Depends to Suggest for Debian. #3105
Changed Java dependency from Depends to Suggest for Debian. #3105
Conversation
…ng the Oracle JAVA distribution and not the OpenJDK. You can suggest it of course. Now the installation will at least continue.
+1, I think it makes sense, @spinscale what do you think? |
I like it. I'll get it in |
Thanks a lot for your contribution! If you have any other recommendations about packaging, feel free to drop me a mail or create other github issues. Happy for any feedback! Pushed into master at 9f43814 |
@spinscale I think it makes sense to back port this to 0.90 as well, what do you think? |
@kimchy pushed it as well into 0.90 |
Actually, there is a big problem with that. After installing the 0.90.2 package the whole jre was removed. Since no package depends on the jre anymore, apt decides to remove it!
Since elasticsearch obviously depends on java it should be stated as a dependency. The only oracle java package i found (https://launchpad.net/~webupd8team/+archive/java) correctly provides java*-runtime that is required by elasticsearch so this shouldn't be an issue. We shouldn't break packaging for those who install oracle java by hand. Those users could "trick" apt by installing a dummy package that satisfies the dependency. This can by done with equivs.
|
This sounds like an issue to fix, I'll check it out. @webpatser do you agree or see another solution to this? |
Sure. If there is no other way.. Maybe add it to the debian installation how to? |
http://www.debian.org/doc/debian-policy/ch-relationships.html Maybe the Enhances flag is better then? Reading the description it should not remove the java packages if present "This field is similar to Suggests but works in the opposite direction. It is used to declare that a package can enhance the functionality of another package.".. (but then again, suggest also doesn't mention this auto-removal).. |
I don't think that enhances will solve the auto removal issue. It is also not appropriate because it states that elasticsearch enhances java's functionality which is not the case. Personally I think the equivs solution is the "correct way" to handle such cases. To make it easier you could provide a java-dummy package from the elasticsearch download page. |
@ctrochalakis I was not yet able to get to the status with apitude like you reached above. Are you using ubuntu as well? Which packages did you delete beforehand in order to get this error? Apart from that I am also coming to the conclusion that neither |
You can also just have no dependency set. I will complain about JAVA when it's not present during startup... Maybe provide a 'apt-get install java..' message in the init script. |
@spinscale Sorry for taking so long to answer. Here are the steps to reproduce the java removal behaviour:
|
I concur with @ctrochalakis. Enhances is definitely very wrong for this, and Suggests is also wrong and can result into apt doing the wrong thing because of a misstated dependency, as it has already been the case for some people. (I'm a Debian Developer). These are Debian packages; coexisting with locally-installed Java defeats the purpose of that. If people really want to install Java locally instead of using make-jpkg or the PPA, they can either use equivs or not use the Elasticsearch .deb at all. Moreover, on issue #3286 it has been mentioned that Elasticsearch is going to provide an apt repository. When that arrives, "apt-get install elasticsearch" should do the right thing and pull the JRE in, instead of just providing a broken package until the sysadmin installs it manually. |
Hey
We are preparing repositories, which will not include a java distribution. Yet, at the same time, we want people to use the newest java version available and preferrably the oracle JDK at the moment. As there problems with having those available (especially having an up-to-date JDK when using the stable debian release and of course the licensing issues for the oracle one) and we do not want people to use equivs, we decided to go this way. We still warn people in the init script if no JDK exists and show how to install the oracle JDK using apt-get on the documentation. You still think, that this is not sufficient to provide a good user experience under the given circumstances or that it is not the debian way? Interested in opinions here. |
I didn't see either of the two, I brought it up because right now there's no dependency whatsoever and none of these two alternatives sounded appealing either. Honestly, I think that a Depends at the virtual package provides the best user experience. But, obviously, I'm a bit biased. I'd also wouldn't use the Oracle JDK either, so I guess I'm doubly biased :) This is off-topic, but why are you recommending that, if I may ask? It should matter less with OpenJDK 7 onwards, no? In any case, most admins that care about a .deb for ElasticSearch would care about a .deb for the JDK as well — on the flip side, I can't imagine why someone would install Java by hand, but wouldn't do the same for Elasticsearch. Besides the OpenJDK, Debian stable provides the "java-package" package for working with Oracle Java ( |
Offtopic answer: Yes, matters less with OpenJDK7, but it is not yet completely gone. Ontopic answer: Actually, it is exactly opposite from our experiences in the fields. Admins care a lot about having a special version of the JDK installed and available and care less about this being a debian package or not (especially in times of puppet/chef automation). A part of the reason for this lies in elasticsearch itself: You have to have the same java version installed, not only between all nodes of an elasticsearch cluster (which most likely runs the same OS anyway), but also between clients, if you use the java API (as the JDK folks tend to change serialization of objects between minor releases). This means, that even across operating system boundaries you want to have the same java version down to the minor version. Java does not have init scripts or needs log file configurations, it is just binary - the elasticsearch debian package comes with these included. So yes, there is a difference between having elasticsearch as a package compared to java. Didnt know the |
That last I heard on the mailing list was that this is gone now. If it is isn't it needs to be. All the problems with the OpenJDK need to be filed as issues, tags, and linked prominently somewhere. I'd be happy to contribute fixes if I knew what was broken.
Elasticsearch has a tradition of installing cleanly and working reasonably well without tuning. Installing the deb package and not getting Java is somewhat against that. In my ideal world it'd install Java and we'd tell folks if they wanted a specific version of Java then to As far as the specific JDK version thing, that is really an argument against using any sort of Java serialization in the Java api. We are going to want to do rolling restarts to upgrade the JDK and I don't want Elasticsearch to blow up when I do it. |
Since people are also using the Oracle JAVA distribution and not the OpenJDK.
Now the installation will at least continue, and it will not give dependency errors when installing other packages after the installation of ElasticSearch.