mirror of
https://github.com/apache/cloudstack
synced 2026-08-02 05:26:35 +00:00
Add support for not (re)starting server after cloud-setup-management.
This adds an option to the cloud-setup-management script to not start the management server after a successful configuration of it. The primary motivation for this is to avoid circular dependency issues on systems that use systemd. When calling cloud-setup-management from a unit with a Before= directive on a service depending on cloudstack-management, the process will deadlock because /usr/bin/service will delegate to systemd, which is waiting for the Before service to start.
This commit is contained in:
parent
37cee3309c
commit
e0e65f5cd6
@ -30,11 +30,14 @@ if __name__ == '__main__':
|
||||
parser = OptionParser()
|
||||
parser.add_option("--https", action="store_true", dest="https", help="Enable HTTPs connection of management server")
|
||||
parser.add_option("--tomcat7", action="store_true", dest="tomcat7", help="Use Tomcat7 configuration files in Management Server")
|
||||
parser.add_option("--no-start", action="store_true", dest="nostart", help="Do not start management server after successful configuration")
|
||||
(options, args) = parser.parse_args()
|
||||
if options.https:
|
||||
glbEnv.svrMode = "HttpsServer"
|
||||
if options.tomcat7:
|
||||
glbEnv.svrConf = "Tomcat7"
|
||||
if options.nostart:
|
||||
glbEnv.noStart = True
|
||||
|
||||
glbEnv.mode = "Server"
|
||||
|
||||
|
||||
@ -20,6 +20,8 @@ class globalEnv:
|
||||
self.mode = None
|
||||
#server mode: normal/mycloud
|
||||
self.svrMode = None
|
||||
#noStart: do not start mgmt server after configuration?
|
||||
self.noStart = False
|
||||
#myCloud/Agent/Console
|
||||
self.agentMode = None
|
||||
#Tomcat6/Tomcat7
|
||||
|
||||
@ -137,7 +137,12 @@ class cloudManagementConfig(serviceCfgBase):
|
||||
pass
|
||||
|
||||
self.syscfg.svo.stopService("cloudstack-management")
|
||||
|
||||
if self.syscfg.env.noStart == False:
|
||||
if self.syscfg.svo.enableService("cloudstack-management"):
|
||||
return True
|
||||
else:
|
||||
raise CloudRuntimeException("Failed to configure %s, please see the /var/log/cloudstack/management/setupManagement.log for detail"%self.serviceName)
|
||||
else:
|
||||
print "Configured successfully, but not starting management server."
|
||||
return True
|
||||
|
||||
Loading…
Reference in New Issue
Block a user