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`.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to