hughsie / zif

Lightweight package manager that's compatible with yum
GNU General Public License v2.0
16 stars 2 forks source link

package lost after strange failing update #4

Closed kiilerix closed 13 years ago

kiilerix commented 13 years ago

It seems like something happens that shouldn't be possible with rpm transactions.

I don't know why it fails with zif and works with yum.

[root@fladmast ~]# rpm -q zif
zif-0.2.3-1.fc16.x86_64

[root@fladmast ~]# rpm -q initscripts
initscripts-9.32-1.fc16.x86_64

[root@fladmast ~]# rpm -q --scripts initscripts
preinstall scriptlet (using /bin/sh):
/usr/sbin/groupadd -g 22 -r -f utmp
postinstall scriptlet (using /bin/sh):
touch /var/log/wtmp /var/run/utmp /var/log/btmp
chown root:utmp /var/log/wtmp /var/run/utmp /var/log/btmp
chmod 664 /var/log/wtmp /var/run/utmp
chmod 600 /var/log/btmp

/sbin/chkconfig --add netfs
/sbin/chkconfig --add network
/sbin/chkconfig --add netconsole
if [ $1 -eq 1 ]; then
        /bin/systemctl daemon-reload > /dev/null 2>&1 || :
fi
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
  /sbin/chkconfig --del netfs
  /sbin/chkconfig --del network
  /sbin/chkconfig --del netconsole
fi
postuninstall scriptlet (using /bin/sh):
if [ $1 -ge 1 ]; then
    /bin/systemctl daemon-reload > /dev/null 2>&1 || :
fi

[root@fladmast ~]# zif update initscripts
Transaction summary:          [==========                    ] <35%>   initscripts-9.32-2.fc16.x86_64 (updates-testing)                                  
  Updating to new versions:
  1.    initscripts-9.32-2.fc16.x86_64 (updates-testing)

Run transaction? [y/N] y
error: %pre(initscripts-9.32-2.fc16.x86_64) scriptlet failed, exit status 126                                            
error: initscripts-9.32-2.fc16.x86_64: install failed
Testing                       [========================      ] <83%>   
The transaction failed: Error -1 running transaction

[root@fladmast ~]# rpm -q initscripts
package initscripts is not installed
[root@fladmast ~]# zif install initscripts
Transaction summary:          [=============                 ] <44%>   initscripts-9.32-2.fc16.x86_64 (updates-testing)                                  
  Installing:
  1.    initscripts-9.32-2.fc16.x86_64 (updates-testing)

Run transaction? [y/N] y
error: %pre(initscripts-9.32-2.fc16.x86_64) scriptlet failed, exit status 126                                            
error: initscripts-9.32-2.fc16.x86_64: install failed

The transaction failed: Error -1 running transaction

[root@fladmast ~]# yum install initscripts
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package initscripts.x86_64 0:9.32-2.fc16 will be installed
--> Finished Dependency Resolution
...
  Installing : initscripts-9.32-2.fc16.x86_64      1/1 
warning: /etc/adjtime created as /etc/adjtime.rpmnew

Installed:
  initscripts.x86_64 0:9.32-2.fc16                                                                                                                                                     

Complete!

[root@fladmast ~]# rpm -q initscripts
initscripts-9.32-2.fc16.x86_64

[root@fladmast ~]# rpm -q --scripts initscripts
preinstall scriptlet (using /bin/sh):
/usr/sbin/groupadd -g 22 -r -f utmp
postinstall scriptlet (using /bin/sh):
touch /var/log/wtmp /var/run/utmp /var/log/btmp
chown root:utmp /var/log/wtmp /var/run/utmp /var/log/btmp
chmod 664 /var/log/wtmp /var/run/utmp
chmod 600 /var/log/btmp

/sbin/chkconfig --add netfs
/sbin/chkconfig --add network
/sbin/chkconfig --add netconsole
if [ $1 -eq 1 ]; then
        /bin/systemctl daemon-reload > /dev/null 2>&1 || :
fi
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
  /sbin/chkconfig --del netfs
  /sbin/chkconfig --del network
  /sbin/chkconfig --del netconsole
fi
postuninstall scriptlet (using /bin/sh):
if [ $1 -ge 1 ]; then
    /bin/systemctl daemon-reload > /dev/null 2>&1 || :
fi

[root@fladmast ~]# yum downgrade initscripts
...
Running Transaction
  Installing : initscripts-9.32-1.fc16.x86_64                                                                                                                                      1/2 
  Cleanup    : initscripts-9.32-2.fc16.x86_64                                                                                                                                      2/2 

Removed:
  initscripts.x86_64 0:9.32-2.fc16                                                                                                                                                     

Installed:
  initscripts.x86_64 0:9.32-1.fc16                                                                                                                                                     

Complete!

[root@fladmast ~]# rpm -q initscripts
initscripts-9.32-1.fc16.x86_64

[root@fladmast ~]# yum update initscripts
...
Running Transaction
  Updating   : initscripts-9.32-2.fc16.x86_64                                                                                                                                      1/2 
  Cleanup    : initscripts-9.32-1.fc16.x86_64                                                                                                                                      2/2 

Updated:
  initscripts.x86_64 0:9.32-2.fc16                                                                                                                                                     

Complete!
hughsie commented 13 years ago

Right, we've debugged this a bit. The only thing it could be is a selinux problem.

This can be "fixed" by doing "chcon -t rpm_exec_t /usr/bin/zif" or just by doing "setenforce 0"

I'll open a bug to get this in the selinux policy. If this doesn't work, can you reopen this report please. Thanks.

hughsie commented 13 years ago

Filed as https://bugzilla.redhat.com/show_bug.cgi?id=740282