Bug 487668

Summary: RHN Solaris client freezes when installing a patch that has been previously unzipped to /tmp
Product: [Community] Spacewalk Reporter: Jan Pazdziora (Red Hat) <jpazdziora>
Component: ClientsAssignee: Jan Pazdziora (Red Hat) <jpazdziora>
Status: CLOSED CURRENTRELEASE QA Contact: Jesus M. Rodriguez <jesusr>
Severity: medium Docs Contact:
Priority: medium    
Version: 0.5CC: bperkins
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Other   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 467349 Environment:
Last Closed: 2009-09-17 07:10:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 456553    

Description Jan Pazdziora (Red Hat) 2009-02-27 11:31:25 UTC
+++ This bug was initially created as a clone of Bug #467349 +++

Description of problem:

When installing a patch, the first step is to unzip the patch into /tmp. However if there already is an old version of the archive in /tmp unzip hangs waiting for user input.

# up2date --get somepatch 
# Unzip it in /tmp
# up2date somepatch
[Freeze]

Packages installed on the Solaris box:

utility     RHATpossl                    pyOpenSSL 0.6
utility     RHATpythn                    python 2.4.1
utility     RHATrcfg                     rhncfg 5.1.0
utility     RHATrcfga                    rhncfg-actions 5.1.0
utility     RHATrcfgc                    rhncfg-client 5.1.0
utility     RHATrcfgm                    rhncfg-management 5.1.0
utility     RHATrhnc                     rhnclient 5.1.0
utility     RHATrhnl                     rhnlib 1.8
utility     RHATsmart                    smartpm 5.1.1

The probably cause of the problem:

In line 63 of /opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/pm.py
                cmdstr = "unzip %s -d %s" % (path, tdir)
Please update to read:
                cmdstr = "unzip %s -u -d %s" % (path, tdir)
Where -u does:
     -u   update existing files and create new  ones  if  needed.
          This  option  performs  the  same  function  as  the -f
          option, extracting (with query) files  that  are  newer
          than  those with the same name on disk, and in addition
          it extracts those files that do not  already  exist  on
          disk.   See  -f  above  for  information on setting the
          timezone properly.

Suggested fix:
make use of `mktemp -d` to create directories in /tmp

Comment 1 Jan Pazdziora (Red Hat) 2009-02-27 11:35:31 UTC
The -u option added, in Spacewalk repo, commit 8557bd24dab10f71ca6b4ff1eefbe40a4c52cb67.

Note that we cannot generally use mktemp because it's not available on SunOS 5.8.

Comment 2 Jan Pazdziora (Red Hat) 2009-02-27 13:03:29 UTC
I've ended up using tempfile.mkdtemp in python, commit 0d271589b6254304cf0eea60a56176f6eeaf7c5a.

Comment 3 Jan Pazdziora (Red Hat) 2009-04-01 06:36:25 UTC
With Spacewalk 0.5 released, moving ON_QA.

Comment 4 Jesus M. Rodriguez 2009-04-14 14:13:20 UTC
Spacewalk 0.5 released.

Comment 5 Miroslav Suchý 2009-09-17 07:10:46 UTC
Spacewalk 0.5 has been released for long time ago.