-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lockfile system in acsInstanceLock #51
Comments
Hola Rodolfo, Is that a problem of CentOS 6.7? Is it using a different version of the Ale On 06/17/2016 09:48 PM, Rodolfo Stephano Castillo Mateluna wrote:
|
As you stated, my system was missing Nevertheless, I would like to recommend using the approach I described in the issue (with Thanks for the response, and sorry for the late feedback! |
Hi Rodolfo, Ale From: Rodolfo Stephano Castillo Mateluna [notifications@github.com] As you stated, my system was missing proemial package. Nevertheless, I would like to recommend using the approach I described in the issue (with lockfile-progs), lockfile-remove seemed cleaner than rm, and there is no need to hardcode suffixes in AcsutilPy.AcsInstanceLockHelper.AcsInstanceLockHelper. Thanks for the response, and sorry for the late feedback! — |
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 in
AcsInstanceLockHelper
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!
The text was updated successfully, but these errors were encountered: