Merge lp:~axwalk/juju-core/lp1292275-localdestroy-stopremovemongod into lp:~go-bot/juju-core/trunk
Proposed by
Andrew Wilkins
Status: | Merged |
---|---|
Merged at revision: | 2472 |
Proposed branch: | lp:~axwalk/juju-core/lp1292275-localdestroy-stopremovemongod |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
22 lines (+5/-0) 1 file modified
provider/local/environ.go (+5/-0) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/lp1292275-localdestroy-stopremovemongod |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+212117@code.launchpad.net |
Description of the change
provider/local: remove mongo service on Destroy
The local provider's Destroy method is modified
to stop and remove the mongodb service we create.
If bootstrap fails, it currently leaves behind
the mongo service. Destroy normally removes the
service by killing jujud with SIGABRT, which
triggers it to clean up; this only works if
bootstrap passes, and the machine agent starts
up successfully.
Since the mongo service may be stopped/removed
by jujud itself, we do not check the error of
stopping/removing the service.
Fixes lp:1292275
To post a comment you must log in.
Reviewers: mp+212117_ code.launchpad. net,
Message:
Please take a look.
Description:
provider/local: remove mongo service on Destroy
The local provider's Destroy method is modified
to stop and remove the mongodb service we create.
If bootstrap fails, it currently leaves behind
the mongo service. Destroy normally removes the
service by killing jujud with SIGABRT, which
triggers it to clean up; this only works if
bootstrap passes, and the machine agent starts
up successfully.
Since the mongo service may be stopped/removed
by jujud itself, we do not check the error of
stopping/removing the service.
Fixes lp:1292275
https:/ /code.launchpad .net/~axwalk/ juju-core/ lp1292275- localdestroy- stopremovemongo d/+merge/ 212117
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/78770043/
Affected files (+7, -0 lines): local/environ. go
A [revision details]
M provider/
Index: [revision details] 20140321051700- yu7igducmicd91p 5
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: provider/ local/environ. go local/environ. go' local/environ. go 2014-03-19 21:08:58 +0000 local/environ. go 2014-03-21 09:01:39 +0000 net/juju- core/state" net/juju- core/state/ api" net/juju- core/state/ api/params" net/juju- core/upstart" net/juju- core/utils/ shell" net/juju- core/version" net/juju- core/worker/ terminationwork er" NewService( env.mongoServic eName() ).StopAndRemove () env.config. rootDir( )); err != nil
=== modified file 'provider/
--- provider/
+++ provider/
@@ -39,6 +39,7 @@
"launchpad.
"launchpad.
"launchpad.
+ "launchpad.
"launchpad.
"launchpad.
"launchpad.
@@ -437,6 +438,10 @@
}
}
}
+ // Stop the mongo database. It's possible that the service
+ // doesn't exist or is not running, so don't check the error.
+ upstart.
+ // Finally, remove the data-dir.
if err := os.RemoveAll(
&& !os.IsNotExist(err) {
return err
}