Service object to handle services on a system-level

The Service object now offers handling services on a system level,
and gathering information whether it's enabled or running.
New methods: enable, disable, is_enabled, is_running;

For this it needs the correct (system-level) service name.
All of the methods can be overridden/customized.

This changes all modules to the new Service object and deletes
action scripts that are not required anymore.
This commit is contained in:
fonfon authored and James Valleroy committed 2016-05-11 18:19:27 -04:00
1 parent 9fe49f881f
commit a9528c56d9
30 files changed
+243 -629

No files matched your search

+2 -2
View File
@@ -64,13 +64,13 @@ def init():
global socks_service
socks_service = service_module.Service(
'tor-socks', _('Tor Anonymity Network'),
is_external=False, enabled=is_enabled())
is_external=False, is_enabled=is_enabled, is_running=is_running)
global bridge_service
bridge_service = service_module.Service(
'tor-bridge', _('Tor Bridge Relay'),
ports=['tor-orport', 'tor-obfs3', 'tor-obfs4'],
is_external=True, enabled=is_enabled())
is_external=True, is_enabled=is_enabled, is_running=is_running)
# Register hidden service name with Name Services module.
hs_info = get_hs()