[ https://issues.apache.org/jira/browse/CLOUDSTACK-9462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15436699#comment-15436699 ]
ASF GitHub Bot commented on CLOUDSTACK-9462: -------------------------------------------- Github user vincentbernat commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1647#discussion_r76226318 --- 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 -- This would overwrite a change made by a user during upgrades. I would suggest to move the first line directly in /etc/default/cloudstack-agent (if it's compatible with RHEL). A user that didn't change anything will get the new file and it will work as expected. A user that did alter the file will get a prompt to solve the situation. However, this won't work with systemd without further ugly hacks. On my system, I notice that `/usr/lib/jvm/default-java` is a symlink. It also seems to be the case on Precise. Maybe you could patch `/etc/default/cloudstack-agent` after installing it in `debian/rules`. > Systemd packaging for Ubuntu 16.04 > ---------------------------------- > > Key: CLOUDSTACK-9462 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9462 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Reporter: Rohit Yadav > Assignee: Rohit Yadav > Fix For: 4.10.0, 4.9.1 > > > Support for building deb packages that will work on Ubuntu 16.04 -- This message was sent by Atlassian JIRA (v6.3.4#6332)