LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   RPM hangs on install/erase/update when scripts are included (https://www.linuxquestions.org/questions/linux-software-2/rpm-hangs-on-install-erase-update-when-scripts-are-included-606294/)

uber-mood 12-12-2007 09:22 AM

RPM hangs on install/erase/update when scripts are included
 
Hi!

I have suddenly got problems updating, erasing and instaling RPM-packages on my Fedora 8.
It just hangs there and the only way to release it, is by killing the process from another console or Ctrl-Z.

This problem only seems to occur on RPM-packages that has builtin post-, preinstall/uninstall scripts.

Like this:

Code:

bash# rpm -U -vvvv at-3.1.10-19.fc8.i386.rpm
.
.
.
D:  install: %post(at-3.1.10-19.fc8.i386) synchronous scriptlet start
D:  install: %post(at-3.1.10-19.fc8.i386)      execv(/bin/sh) pid 3257
+ touch /var/spool/at/.SEQ
+ chmod 600 /var/spool/at/.SEQ
+ chown daemon:daemon /var/spool/at/.SEQ
+ /sbin/chkconfig --add atd

[hang]

This seems to happen on all RPMs that have scripts included. It just sits there, doing nothing..

I have tried to
Code:

rm -f /var/lib/rpm/__db*; rpm --rebuilddb
a couple of times, without success.

Running strace on the pid of my hanging rpm process, shows this:

Code:

bash# strace -p 3353
Process 3353 attached - interrupt to quit
--- SIG_0 (Unknown signal 0) @ 0 (0) ---
futex(0x9307134, FUTEX_WAIT_PRIVATE, 2,NULL


I've been googling around a lot, but can't find any solution..
Please, help!

unSpawn 12-12-2007 04:21 PM

Quote:

Originally Posted by uber-mood (Post 2988318)
Hi!

Hello and welcome to LQ. Hope you like it here.


Quote:

Originally Posted by uber-mood (Post 2988318)
I have suddenly got problems updating, erasing and instaling RPM-packages on my Fedora 8.

So this started at some point? Can you trace back around what time it started? And check the logs for what changed? Any updates? BTW 0: can you install or upgrade rpm's if you use "--noscripts"? BTW 1: you're using Fedora 8 so it would be good to check and add a ticket to their bug tracker if the problem is not mentioned there already.

uber-mood 12-12-2007 04:35 PM

Yup. When running with the --no-scripts option, it doesn't hang..

Hmm, and when checking my yum.log to see when it last worked, it looks like my RPM problems started after 5:th Dec, when done with these updates/installs:

Code:

Dec 05 20:27:40 Updated: yum - 3.2.7-2.fc8.noarch
Dec 05 20:27:41 Installed: nss-tools - 3.11.7-10.fc8.i386
Dec 05 20:27:42 Updated: sendmail - 8.14.2-1.fc8.i386
Dec 05 20:27:43 Installed: gamin-python - 0.1.9-4.fc8.i386
Dec 05 20:27:44 Installed: fuse - 2.7.0-8.fc8.i386
Dec 05 20:27:48 Installed: pcsc-lite-libs - 1.3.3-1.fc8.i386
Dec 05 20:27:49 Installed: fuse-libs - 2.7.0-8.fc8.i386
Dec 05 20:27:50 Installed: ntfs-3g - 2:1.1120-1.fc8.i386
Dec 05 20:27:50 Installed: irqbalance - 2:0.55-7.fc8.i386
Dec 05 20:27:52 Installed: ntfsprogs - 1.13.1-8.fc8.i386
Dec 05 20:27:52 Installed: smartmontools - 1:5.37-7.1.fc8.i386
Dec 05 20:27:53 Installed: device-mapper-multipath - 0.4.7-11.fc7.i386
Dec 05 20:27:53 Installed: microcode_ctl - 1:1.17-1.38.fc8.i386
Dec 05 20:27:53 Installed: tree - 1.5.0-8.fc8.i386
Dec 05 20:27:54 Installed: usbutils - 0.71-2.1.i386
Dec 05 20:27:54 Installed: pam_pkcs11 - 0.5.3-25.i386
Dec 05 20:27:55 Installed: rng-utils - 1:2.0-1.14.1.fc6.i386
Dec 05 20:27:55 Installed: yum-updatesd - 1:0.7-1.fc8.noarch
Dec 05 20:27:56 Updated: sendmail-cf - 8.14.2-1.fc8.i386
Dec 05 20:27:57 Updated: NetworkManager-glib - 1:0.7.0-0.6.6.svn3109.fc8.i386
Dec 05 20:27:58 Updated: NetworkManager - 1:0.7.0-0.6.6.svn3109.fc8.i386
Dec 05 20:27:59 Installed: pcsc-lite - 1.3.3-1.fc8.i386
Dec 05 20:27:59 Installed: ccid - 1.2.1-3.fc8.i386
Dec 05 20:28:00 Installed: ifd-egate - 0.05-19.i386
Dec 05 20:28:00 Installed: coolkey - 1.1.0-5.fc8.i386
Dec 05 20:29:37 Installed: fakeroot - 1.6.4-15.fc7.i386
Dec 05 20:29:38 Installed: sparse - 0.4.1-1.fc8.i386
Dec 05 20:29:38 Installed: rpmdevtools - 6.4-1.fc8.noarch
Dec 05 20:29:38 Installed: unifdef - 1.171-6.fc8.i386

Can somebody here identify any of these packages that could cause this problem?

unSpawn 12-12-2007 05:15 PM

It's clear some yum and RPM stuff got upgraded. I'd definately get on the F8 user mailing list /bug tracker with this.


Now I don't know how mad your CLI skills are (so below may be horror to you) but until you fix it there's a way to extract scriptlets and run them. Here's an example how, maybe somebody is willing to make it a nice script. Say you got a rpm called "my.rpm". You can query it for what scripts it runs with 'rpm -qp --scripts my.rpm'. Since there's only a few possibilities you can find out which one you'll need with 'rpm -qp --scripts my.rpm|grep -n '^p.*scriptlet.*:$'' and it'll return something like this:
Code:

1:postinstall scriptlet (using /bin/sh):
21:preuninstall scriptlet (using /bin/sh):
26:postuninstall scriptlet (using /bin/sh):

so this shows the postinstall script runs from line 2 to 21 and the preuninstall from line 22 to line 26. Now you can extract the postinstall script with 'rpm -qp --scripts my.rpm|sed -n '21q;2,21p'>/tmp/my.sh' and then 'sh /tmp/my.sh'. Dunno if that was helpful.

uber-mood 12-12-2007 07:41 PM

Thanks for your kind help!

I think I managed to solve the problem now, by simply uninstalling package "yum-updatesd". Directly after uninstall, RPM-command started to work again.

Strangely enough, RPM still works flawlessly after reinstalling "yum-updatesd" back to the system. Not sure what happened here.. :rolleyes: but it's working!

unSpawn 12-13-2007 01:55 AM

Well done fixing things yourself!


All times are GMT -5. The time now is 02:49 AM.