Github user rhtyd commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1647#discussion_r76227828
--- Diff: debian/cloudstack-agent.postinst ---
@@ -41,6 +41,12 @@ case "$1" in
mkdir /etc/libvirt/hooks
fi
cp -a /usr/share/cloudstack-agent/lib/libvirtqemuhook
/etc/libvirt/hooks/qemu
+
+ # Update JAVA_HOME in /etc/default/cloudstack-agent to default JRE
+ JAVA_HOME=$(readlink -f /usr/bin/java | sed 's/\/jre.*java//g')
+ if [ -d "$JAVA_HOME" ]; then
+ sed -i "s:^JAVA_HOME=.*:JAVA_HOME=${JAVA_HOME}:"
/etc/default/cloudstack-agent
+ fi
--- End diff --
@vincentbernat thanks, it makes sense. I'll see if we can move this to the
`default/files`. An alternative is to document this, we can keep some default
path and in our installation/upgrade documentation suggest the admin to fix the
JAVA_HOME here if it's something non-default. The code I've used here simply
replaces JAVA_HOME to whatever is set globally on that host.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---