www.cendio.com
Bug 4360 - zypperbackend lock file creation can fail on common partitioning layouts
: zypperbackend lock file creation can fail on common partitioning layouts
Status: CLOSED FIXED
: ThinLinc
Server Installer
: 3.4.0
: PC Unknown
: P2 Normal
: 4.0.0
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-07-06 09:51 by
Modified: 2012-11-28 12:37 (History)
Acceptance Criteria:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From cendio 2012-07-06 09:51:56
From issue #13481:

---
2012-07-05 17:35:36,798: Creating zypper lock...
2012-07-05 17:35:36,799: Failed to create zypper lock file: [Errno 18] Invalid
cross-device link
2012-07-05 17:35:36,801: Traceback (most recent call last):
2012-07-05 17:35:36,801:   File
"/opt/thinlinc/modules/thinlinc/tlsetup/pkginsthelp.py", line 44, in <lambda>
2012-07-05 17:35:36,801:     self . __worker_thread = thread . start_new_thread
( lambda : self . __worker ( ) , ( ) )
2012-07-05 17:35:36,801:   File
"/opt/thinlinc/modules/thinlinc/tlsetup/pkginsthelp.py", line 51, in __worker
2012-07-05 17:35:36,801:     self . __job ( )
2012-07-05 17:35:36,801:   File
"/opt/thinlinc/modules/thinlinc/tlsetup/pkginsthelp.py", line 215, in
__resolver_job
2012-07-05 17:35:36,801:     if iI ( self . __packageinstaller ) :
2012-07-05 17:35:36,801:   File
"/opt/thinlinc/modules/thinlinc/tlsetup/pkginsthelp.py", line 108, in iI
2012-07-05 17:35:36,801:     oo = backend . resolve ( )
2012-07-05 17:35:36,801:   File
"/opt/thinlinc/modules/thinlinc/packageinstaller/zypperbackend.py", line 397,
in resolve
2012-07-05 17:35:36,802:     self . lock ( )
2012-07-05 17:35:36,802:   File
"/opt/thinlinc/modules/thinlinc/packageinstaller/zypperbackend.py", line 317,
in lock
2012-07-05 17:35:36,802:     raise Exception ( "Failed to create zypper lock
file" )
2012-07-05 17:35:36,802: Exception: Failed to create zypper lock file
---

In this case, if /tmp and /var/run are not on the same partition, trying to
move the lock file os.rename() (zypperbackend.py:313) will fail. From
http://docs.python.org/library/os.html?highlight=os.rename#os.rename:

"The operation may fail on some Unix flavors if src and dst are on different
filesystems"

To resolve this, the lock file should be created in place by specifying the
target directory when calling tempfile.mkstemp().
------- Comment #1 From cendio 2012-07-06 10:13:46 -------
Created an attachment (id=447) [details]
Suggested patch
------- Comment #2 From cendio 2012-08-29 13:05:37 -------
Fixed in r25683. Now creates temp file in target directory. Initial testing
performed on SLED11SP2, seems to work fine.
------- Comment #3 From cendio 2012-10-22 11:12:30 -------
Works great. Tested on SLED11SP2, after doing:

mount -t tmpfs /tmp /tmp