From ef89793c4e0265af0c4cc53feddc63544253b1d6 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Wed, 9 Jan 2013 13:11:21 +0100 Subject: [PATCH] init: Explicitly set the HOME variable to the homedir of the user cloud We have to explicitly set the HOME variable to the homedir from the user "cloud" This is because various scripts run by the management server read the HOME variable and fail when this init script is run manually. For example the injectkeys.sh script reads the HOME variable --- client/distro/ubuntu/SYSCONFDIR/init.d/cloud-management.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/distro/ubuntu/SYSCONFDIR/init.d/cloud-management.in b/client/distro/ubuntu/SYSCONFDIR/init.d/cloud-management.in index 5ed86c2ceb5..4afa707a9e9 100755 --- a/client/distro/ubuntu/SYSCONFDIR/init.d/cloud-management.in +++ b/client/distro/ubuntu/SYSCONFDIR/init.d/cloud-management.in @@ -38,6 +38,11 @@ CATALINA_HOME=@MSENVIRON@ DEFAULT=@MSCONF@/tomcat6.conf JVM_TMP=/tmp/$NAME-temp +# We have to explicitly set the HOME variable to the homedir from the user "cloud" +# This is because various scripts run by the management server read the HOME variable +# and fail when this init script is run manually. +HOME=$(echo ~cloud) + if [ `id -u` -ne 0 ]; then echo "You need root privileges to run this script" exit 1