removed startup service
This commit is contained in:
parent
3443937ff2
commit
ed4e6f0f00
2 changed files with 2 additions and 50 deletions
|
@ -1,38 +0,0 @@
|
|||
from inspect import isclass
|
||||
from sys import maxint
|
||||
|
||||
from core.service import CoreService
|
||||
|
||||
|
||||
class Startup(CoreService):
|
||||
"""
|
||||
A CORE service to start other services in order, serially
|
||||
"""
|
||||
name = 'startup'
|
||||
group = 'Utility'
|
||||
depends = ()
|
||||
dirs = ()
|
||||
configs = ('startup.sh',)
|
||||
startindex = maxint
|
||||
startup = ('sh startup.sh',)
|
||||
shutdown = ()
|
||||
validate = ()
|
||||
|
||||
@staticmethod
|
||||
def is_startup_service(s):
|
||||
return isinstance(s, Startup) or (isclass(s) and issubclass(s, Startup))
|
||||
|
||||
@classmethod
|
||||
def generateconfig(cls, node, filename, services):
|
||||
if filename != cls.configs[0]:
|
||||
return ''
|
||||
script = '#!/bin/sh\n' \
|
||||
'# auto-generated by Startup (startup.py)\n\n' \
|
||||
'exec > startup.log 2>&1\n\n'
|
||||
for s in sorted(services, key=lambda x: x.startindex):
|
||||
if cls.is_startup_service(s) or len(str(s.starttime)) > 0:
|
||||
continue
|
||||
start = '\n'.join(s.getstartup(node, services))
|
||||
if start:
|
||||
script += start + '\n'
|
||||
return script
|
Loading…
Add table
Add a link
Reference in a new issue