2017-08-03 22:27:39 +01:00
|
|
|
"""
|
|
|
|
Sample user-defined services for testing.
|
|
|
|
"""
|
|
|
|
|
2019-04-30 07:31:47 +01:00
|
|
|
from core.services.coreservices import CoreService
|
2017-08-03 22:27:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
class MyService(CoreService):
|
2018-06-15 22:03:27 +01:00
|
|
|
name = "MyService"
|
|
|
|
group = "Utility"
|
2018-06-22 16:16:59 +01:00
|
|
|
configs = ("myservice.sh",)
|
|
|
|
startup = ("sh myservice.sh",)
|
2018-06-22 23:47:02 +01:00
|
|
|
shutdown = ("sh myservice.sh",)
|
2017-08-03 22:27:39 +01:00
|
|
|
|
2018-06-22 23:47:02 +01:00
|
|
|
@classmethod
|
|
|
|
def generate_config(cls, node, filename):
|
|
|
|
return "# test file"
|
2017-08-03 22:27:39 +01:00
|
|
|
|
2018-06-22 23:47:02 +01:00
|
|
|
|
|
|
|
class MyService2(MyService):
|
2018-06-15 22:03:27 +01:00
|
|
|
name = "MyService2"
|
|
|
|
group = "Utility"
|
2018-06-22 23:47:02 +01:00
|
|
|
configs = ("myservice2.sh",)
|
|
|
|
startup = ("sh myservice2.sh",)
|
2018-06-25 16:41:23 +01:00
|
|
|
shutdown = startup
|
|
|
|
validate = startup
|
2018-06-22 23:47:02 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def generate_config(cls, node, filename):
|
|
|
|
return "exit 1"
|