-
Notifications
You must be signed in to change notification settings - Fork 26
Description
acsInstanceLock uses AcsutilPy.AcsInstanceLockHelper.AcsInstanceLockHelper
as backend, in which I've found some issues:
lock(self, instance)
method makes use oflockfile
unix command (call(["lockfile","-r-0",lockFileName])
). The system I'm testing ACS on (CentOS 6.7),lockfile
utility is provided under the name oflockfile-create
within thelockfile-progs
suite. That causes problems when trying to useacsStart
andacsStop
ACS commands.AcsInstanceLockHelper
defines '.lock' suffix for the lock's name generated by__buildLockFileName(self, instance)
. The "problem" here is thatlockfile
(or lockfile suite for that matter) already adds '.lock' suffix to the name unless-l
option is passed as parameter. So for example, if we are working onACS_INSTACE=0
, the generated name would beacsInstance0.lock.lock
; this is inconvenient forunlock(self, instance)
method, since it usesrm
to remove the lockfile.
Possible solution: remove suffix definition inAcsInstanceLockHelper
and uselockfile-remove
utility fromlockfile-progs
suite instead ofrm
to unlock.
For completeness I attach the error when lockfile
command is missing (Note at the end there is an inaccurate definition of the error):
ip177 root:/opt/alma/ACS-2015.4 1021 > acsStart -v Locking instance 0 with lock file /opt/alma/ACS-2015.4/acsdata/tmp/acsInstance0.lock Traceback (most recent call last): File "/opt/alma/ACS-2015.4/ACSSW/bin/acsInstanceLock", line 87, in <module> ret=lockHelper.checkAndLock() File "/opt/alma/ACS-2015.4/ACSSW/lib/python/site-packages/AcsutilPy/AcsInstanceLockHelper.py", line 176, in checkAndLock ret = self.lock(int(self.__instanceEnvVar)) File "/opt/alma/ACS-2015.4/ACSSW/lib/python/site-packages/AcsutilPy/AcsInstanceLockHelper.py", line 114, in lock return call(["lockfile","-r-0",lockFileName]) File "/usr/lib64/python2.6/subprocess.py", line 478, in call p = Popen(*popenargs, **kwargs) File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__ errread, errwrite) File "/usr/lib64/python2.6/subprocess.py", line 1238, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory 2016-06-14T23:44:03.728 ERROR [acsStart] Unable to continue as there is already a lock file for ACS_INSTANCE 0 in /opt/alma/ACS-2015.4/acsdata/tmp!