fetched mlz version
- before some chamges in the gerrit pipline Change-Id: I33eb2d75f83345a7039d0fb709e66defefb1c3e0
This commit is contained in:
@ -25,33 +25,33 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
import fnmatch
|
||||
from os import path
|
||||
|
||||
from secop.lib import getGeneralConfig
|
||||
from frappy.lib import generalConfig
|
||||
|
||||
|
||||
def main():
|
||||
normal_dir = sys.argv[1]
|
||||
|
||||
global_config = getGeneralConfig()
|
||||
config_dir = global_config['confdir']
|
||||
generalConfig.init()
|
||||
config_dir = generalConfig['confdir']
|
||||
|
||||
secop_unit = '/lib/systemd/system/secop@.service'
|
||||
wants_dir = normal_dir + '/secop.target.wants'
|
||||
frappy_unit = '/lib/systemd/system/frappy@.service'
|
||||
wants_dir = normal_dir + '/frappy.target.wants'
|
||||
|
||||
all_servers = [base for (base, ext) in
|
||||
map(path.splitext, os.listdir(config_dir)) if ext == '.cfg']
|
||||
all_servers = [base.rstrip('_cfg') for (base, ext) in
|
||||
map(path.splitext, os.listdir(config_dir)) if ext == '.py']
|
||||
all_servers.sort()
|
||||
|
||||
for srv in all_servers:
|
||||
symlink = '%s/secop@%s.service' % (normal_dir, srv)
|
||||
os.symlink(secop_unit, symlink)
|
||||
symlink = '%s/frappy@%s.service' % (normal_dir, srv)
|
||||
os.symlink(frappy_unit, symlink)
|
||||
if not path.isdir(wants_dir):
|
||||
os.mkdir(wants_dir)
|
||||
os.symlink(symlink, '%s/%s' % (wants_dir, path.basename(symlink)))
|
||||
|
||||
# the stamp file signals successful run of the generator
|
||||
open(normal_dir + '/secop.stamp', 'w').close()
|
||||
open(normal_dir + '/frappy.stamp', 'w').close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
@ -1,10 +1,10 @@
|
||||
[Unit]
|
||||
Description=SECoP SEC-node: %i
|
||||
Description=FRAPPY SECoP SEC-node: %i
|
||||
After=network-online.service
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
ExecStart=/usr/bin/secop-server %I
|
||||
ExecStart=/usr/bin/frappy-server %I
|
||||
Restart=on-abnormal
|
||||
RestartSec=30
|
||||
|
Reference in New Issue
Block a user