Ask Your Question
0

Yum postun scriptlet

asked 2013-03-06 10:02:46 -0500

Jason Compcom gravatar image

updated 2014-09-28 21:07:38 -0500

mether gravatar image

Hi Guys,

I'm building some rpms for a customer of mine, so he can deploy his application more easily in his company environment (FC17 x86_64). Now I was experiencing the problem, that the %postun scriptlet never get's called when the resulting rpm package is handled with yum. If I erase (rpm -e) the same package, the %postun get's called.

I have built a "debug" rpm which is only displaying the scriptlets name (pretrans,pre,...,postun,posttrans), just to see that it's not a fault in the spec file.

Any help would be appreciated, why this is happening, and how to overcome the problem.

The demo-spec for building the rpm can be found here nopaste.info/0712df868c.html

Output is as follows:

$ rpm -ivh tmp/rpm-scriptlet-debugger-1.0.0-1.fc17.noarch.rpm 
    PRETRANS(1.0.0-1.fc17): 0
 Preparing...             ########################################### [100%]
    PRE(1.0.0-1.fc17):  1
 1:rpm-scriptlet-debugger ########################################### [100%]
    POST(1.0.0-1.fc17): 1
    POSTTRANS(1.0.0-1.fc17):    0

$ rpm -ev rpm-scriptlet-debugger 
    PREUN(1.0.0-1.fc17):    0
    POSTUN(1.0.0-1.fc17):   0

and

$ yum install tmp/rpm-scriptlet-debugger-1.0.0-1.fc17.noarch.rpm 
[...]
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : rpm-scriptlet-debugger-1.0.0-1.fc17.noarch                           1/1 
    PRETRANS(1.0.0-1.fc17): 0
    PRE(1.0.0-1.fc17):  1
    POST(1.0.0-1.fc17): 1
  Verifying  : rpm-scriptlet-debugger-1.0.0-1.fc17.noarch                           1/1 

Installed:
  rpm-scriptlet-debugger.noarch 0:1.0.0-1.fc17                                                                              

Complete!

$ yum remove rpm-scriptlet-debugger
[...]
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : rpm-scriptlet-debugger-1.0.0-1.fc17.noarch                           1/1 
    PREUN(1.0.0-1.fc17):    0
  Verifying  : rpm-scriptlet-debugger-1.0.0-1.fc17.noarch                           1/1 

Removed:
  rpm-scriptlet-debugger.noarch 0:1.0.0-1.fc17                                                                              

Complete!

So, give it a try, and tell me what am I doing wrong? Thanks in advance,

Jason

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2013-03-06 11:14:58 -0500

mether gravatar image

updated 2014-09-28 21:08:30 -0500

So, I spend sometime testing this and here is what I found:

When removing using RPM, the echo statement is shown in the shell however %postun is indeed getting called. The way I tested that is to run "touch /tmp/removeme" and %postun run "rm -f /tmp/removeme" and verified that the file does get removed. So if you want to echo something to the shell during post uninstallation, which is generally considered bad form really because a graphical UI for package manangement, will never show that at all, you should file this as a bug. Use report yum bug

edit flag offensive delete link more

Comments

You're completely right! The echo has just been for debugging reasons. I just didn't try, if the scriplet is called and output passed to /dev/null - but I can confirm it's indeed working - without the output. Thanks for the hint!

Jason Compcom gravatar imageJason Compcom ( 2013-03-07 05:53:25 -0500 )edit
0

answered 2013-03-07 11:28:31 -0500

mether gravatar image

You are welcome. Bug report filed at https://bugzilla.redhat.com/show_bug.cgi?id=919151

edit flag offensive delete link more
0

answered 2014-03-17 11:19:05 -0500

fgysin gravatar image

Very nice spot! This just cost me two hours... :P I would upvote this, but can't because I just created this account...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-03-06 10:02:46 -0500

Seen: 1,417 times

Last updated: Sep 28 '14