[
https://issues.apache.org/jira/browse/CLOUDSTACK-9462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15437659#comment-15437659
]
ASF GitHub Bot commented on CLOUDSTACK-9462:
--------------------------------------------
Github user rhtyd commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1647#discussion_r76323706
--- Diff: packaging/systemd/cloudstack-agent.default ---
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+JAVA_HOME=/usr/lib/jvm/jre
+if [ ! -f "$JAVA_HOME"/bin/java ] ; then
+ JAVA_HOME=$(readlink -f /usr/bin/java | sed 's:/bin/java::')
+fi
--- End diff --
@vincentbernat yes this worked for me both on CentOS 7.2, Ubuntu 16.04
(systemd). Can you build packages and help with a secondary test. When the
service starts it executes the environment/default file which gives us the
$(readlink...) to replace $JAVA_HOME usage. I see this in my CentOS 7.2
environment (and similar on Ubuntu 16.04):
```
root 27929 0.0 0.0 115340 1616 ? Ss 20:57 0:00 /bin/sh
-ec export UCP=`ls /usr/share/cloudstack-usage/cloud-usage-*.jar
/usr/share/cloudstack-usage/lib/*.jar /usr/share/cloudstack-mysql-ha/lib/*.jar
| tr "\n" ":"`; export
CLASSPATH="$UCP:/etc/cloudstack/usage:/usr/share/java/mysql-connector-java.jar";
$(readlink -f /usr/bin/java | sed 's:/bin/java::')/bin/java -Dpid=$$
-Xms256m -Xmx2048m -cp "$CLASSPATH" $JAVA_CLASS
root 27936 7.4 13.3 3616388 251860 ? Sl 20:57 0:07 java
-Dpid=27929 -Xms256m -Xmx2048m -cp
/usr/share/cloudstack-usage/cloud-usage-4.9.1.0-SNAPSHOT.jar:/usr/share/cloudstack-usage/lib/activation-1.1.jar:/usr/share/cloudstack-usage/lib/annotations-2.0.1.jar:/usr/share/cloudstack-usage/lib/antisamy-1.5.3.jar:/usr/share/cloudstack-usage/lib/aopalliance-1.0.jar
```
> 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)