CloudStack Usage Server Fails To Start

On a freshly installed Apache CloudStack 4.3.0 installation, the cloudstack-usage server fails to start as below:

[root@csman11 ~]# /etc/init.d/cloudstack-usage start
Starting CloudStack Usage Monitor cloudstack-usage19/06/2014 15:37:20 27499 jsvc error: Cannot locate Java Home
cat: /var/run/ No such file or directory [FAILED]

This is probably a side effect of newer version of OpenJDK being released for CentOS via EPEL which /etc/init.d/cloudstack-usage start script does not know about.

[root@csman11 ~]# rpm -qa|grep ^java

The right location for java-1.7.0-openjdk JAVA_HOME is /usr/lib/jvm/java-1.7.0-openjdk- and and is easily fixed with the below patch:

[root@csman11 init.d]# diff -u cloudstack-usage.O cloudstack-usage
— cloudstack-usage.O 2014-06-19 15:46:20.156953908 +0530
+++ cloudstack-usage 2014-06-19 15:46:59.056954438 +0530
@@ -42,6 +42,7 @@

[ -r /etc/sysconfig/"$SHORTNAME" ] && source /etc/sysconfig/"$SHORTNAME"

[root@csman11 init.d]# /etc/init.d/cloudstack-usage start
Starting CloudStack Usage Monitor cloudstack-usage [ OK ]

By Shanker Balan

Shanker Balan is a devops and infrastructure freelancer with over 14 years of industry experience in large scale Internet systems. He is available for both short term and long term projects on contract. Please use the Contact Form for any enquiry.

Leave a comment

Your email address will not be published. Required fields are marked *