Commit 8a4b339b authored by Devaev Maxim's avatar Devaev Maxim

Refactoring, policy update for fmod_system_service

parent c085bee1
......@@ -55,6 +55,7 @@
<!-- fmod_system_services -->
<policy context="default">
<allow send_destination="org.etersoft.settingsd" send_interface="org.etersoft.settingsd.functions.systemServices" send_member="servicesChanged"/>
<allow send_destination="org.etersoft.settingsd" send_interface="org.etersoft.settingsd.functions.systemService" send_member="description"/>
<allow send_destination="org.etersoft.settingsd" send_interface="org.etersoft.settingsd.functions.systemService" send_member="shortDescription"/>
<allow send_destination="org.etersoft.settingsd" send_interface="org.etersoft.settingsd.functions.systemService" send_member="levelsMap"/>
......
......@@ -40,6 +40,12 @@ class SystemService(service.FunctionObject) :
self.__system_service_name = system_service_name
### Public ###
def name(self) :
return self.__system_service_name
### DBus methods ###
@service.functionMethod(SYSTEM_SERVICE_METHODS_NAMESPACE, in_signature="s", out_signature="i")
......@@ -101,7 +107,8 @@ class SystemService(service.FunctionObject) :
logger.verbose("Request to %s service \"%s\" on runlevels \"%s\"" % ( ( "enable" if enabled_flag else "disable" ),
self.__system_service_name, ( levels if levels != None else "default" ) ))
proc_args = "%s %s %s %s" % ( config.value(SERVICE_NAME, "chkconfig_prog_path"), ( "--level %s" % (levels) if levels != None else "" ),
proc_args = "%s %s %s %s" % ( config.value(SERVICE_NAME, "chkconfig_prog_path"),
( "--level %s" % (levels) if levels != None else "" ),
self.__system_service_name, ( "on" if enabled_flag else "off" ) )
return tools.process.execProcess(proc_args, False)[2]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment