@@ -70,7 +70,6 @@ def _control_component(self, cmds):
70
70
def create_component (self , staged_component_path , application_name , user_name , component , properties ):
71
71
logging .debug ("create_component: %s %s %s %s" , application_name , user_name , json .dumps (component ), properties )
72
72
distro = platform .dist ()
73
- usesSystemd = distro [0 ] in ('redhat' , 'centos' )
74
73
remote_component_tmp_path = '%s/%s/%s' % (
75
74
'/tmp/%s' % self ._namespace , application_name , component ['component_name' ])
76
75
remote_component_install_path = '%s/%s/%s' % (
@@ -108,12 +107,8 @@ def create_component(self, staged_component_path, application_name, user_name, c
108
107
109
108
this_dir = os .path .dirname (os .path .realpath (__file__ ))
110
109
copy (os .path .join (this_dir , 'yarn-kill.py' ), staged_component_path )
111
- if usesSystemd :
112
- service_script = 'systemd.service.tpl' if java_app else 'systemd.service.py.tpl'
113
- service_script_install_path = '/usr/lib/systemd/system/%s.service' % service_name
114
- else :
115
- service_script = 'upstart.conf.tpl' if java_app else 'upstart.conf.py.tpl'
116
- service_script_install_path = '/etc/init/%s.conf' % service_name
110
+ service_script = 'systemd.service.tpl' if java_app else 'systemd.service.py.tpl'
111
+ service_script_install_path = '/usr/lib/systemd/system/%s.service' % service_name
117
112
copy (os .path .join (this_dir , service_script ), staged_component_path )
118
113
119
114
self ._fill_properties (os .path .join (staged_component_path , service_script ), properties )
@@ -153,8 +148,7 @@ def create_component(self, staged_component_path, application_name, user_name, c
153
148
logging .debug ("uninstall commands: %s" , undo_commands )
154
149
155
150
start_commands = []
156
- if usesSystemd :
157
- start_commands .append ('sudo systemctl daemon-reload\n ' )
151
+ start_commands .append ('sudo systemctl daemon-reload\n ' )
158
152
start_commands .append ('sudo service %s start\n ' % service_name )
159
153
logging .debug ("start commands: %s" , start_commands )
160
154
0 commit comments