reload SeaServer executable when needed
This commit is contained in:
parent
b81c98448d
commit
6c04fac37f
14
seaman.py
14
seaman.py
@ -25,6 +25,7 @@ import time
|
||||
import termios
|
||||
import subprocess
|
||||
import os
|
||||
from os.path import join, exists
|
||||
from servicemanager.base import ServiceManager, ServiceDown, UsageError
|
||||
from servicemanager.sicsclient import sics_client
|
||||
|
||||
@ -94,6 +95,19 @@ class SeaManager(ServiceManager):
|
||||
print('starting sea gui %s' % ' '.join(args))
|
||||
time.sleep(5)
|
||||
|
||||
def prepare_start(self, ins, service, *args):
|
||||
start_dir, env = super().prepare_start(ins, service)
|
||||
# load newest version of SeaServer if needed
|
||||
os.chdir(start_dir)
|
||||
sea_server_src = os.environ.get(
|
||||
'SEA_SERVER_SRC', '/afs/psi.ch/user/z/zolliker/public/git.rhel7/sics/SeaServer')
|
||||
if sea_server_src and exists(sea_server_src):
|
||||
if os.system('diff %s SeaServer' % sea_server_src):
|
||||
print('reload SeaServer')
|
||||
os.rename('SeaServer', 'SeaServer0')
|
||||
os.system('cp %s ./' % sea_server_src)
|
||||
return start_dir, env
|
||||
|
||||
def get_cfg(self, ins, service):
|
||||
"""return cfg info about running programs, if relevant
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user