Skip to content

Commit ae2c5d9

Browse files
committed
Bug 11539 - SSVM stop script doesn't work
status 11539: resolved fixed reviewed-by: edison Conflicts: console-proxy/scripts/run.sh
1 parent b06543a commit ae2c5d9

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

  • console-proxy/scripts
  • patches/systemvm/debian/config/etc/init.d

‎console-proxy/scripts/run.sh‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ do
3232
if [ $ex -eq 0 ] || [ $ex -eq 1 ] || [ $ex -eq 66 ] || [ $ex -gt 128 ]; then
3333
# permanent errors
3434
sleep 5
35-
elif [ $ex -eq 143 ]; then
36-
# service cloud stop causes exit with 143
37-
exit $ex
35+
fi
36+
37+
# user stop agent by service cloud stop
38+
grep 'stop' /usr/local/cloud/systemvm/user_request &>/dev/null
39+
if [ $? -eq 0 ]; then
40+
timestamp=$(date)
41+
echo "$timestamp User stops cloud.com service" >> /var/log/cloud.log
42+
exit 0
3843
fi
3944
sleep 5
4045
done

‎patches/systemvm/debian/config/etc/init.d/cloud‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ get_pids() {
7272

7373
start() {
7474
local pid=$(get_pids)
75+
if [ "$pid" != "" ]; then
76+
echo "cloud.com sevice is already running, PID = $pid"
77+
return 0
78+
fi
79+
7580
echo -n "Starting cloud.com service (type=$TYPE) "
7681
if [ -f $CLOUD_COM_HOME/systemvm/run.sh ];
7782
then
@@ -86,6 +91,7 @@ start() {
8691
_failure
8792
fi
8893
echo
94+
echo 'start' > $CLOUD_COM_HOME/systemvm/user_request
8995
}
9096

9197
stop() {
@@ -97,6 +103,7 @@ stop() {
97103
done
98104
_success
99105
echo
106+
echo 'stop' > $CLOUD_COM_HOME/systemvm/user_request
100107
}
101108

102109
status() {

0 commit comments

Comments
 (0)