Bug 1257116 - warning: %postun(mcelog-3:101-3.9de4924.el7.x86_64) scriptlet failed, exit status 1
warning: %postun(mcelog-3:101-3.9de4924.el7.x86_64) scriptlet failed, exit st...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: mcelog (Show other bugs)
7.2
Unspecified Unspecified
urgent Severity high
: rc
: 7.3
Assigned To: Prarit Bhargava
Andrej Manduch
: ZStream
Depends On:
Blocks: 1353018 1446211 1388427
  Show dependency treegraph
 
Reported: 2015-08-26 06:10 EDT by Marian Ganisin
Modified: 2017-08-01 08:46 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
: 1388427 (view as bug list)
Environment:
Last Closed: 2017-08-01 08:46:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2218 normal SHIPPED_LIVE mcelog bug fix and enhancement update 2017-08-01 12:10:14 EDT

  None (edit)
Description Marian Ganisin 2015-08-26 06:10:24 EDT
Description of problem:

During upgrade I see following message:

warning: %postun(mcelog-3:101-3.9de4924.el7.x86_64) scriptlet failed, exit status 1


I briefly checked rpm scriptelts of mcelog-120-2.e7e0ac1.el7.x86_64.rpm (not the same version!) this piece of code might cause it:

# Handle upgrading mcelog
if [ "$1" -ge 1 ]; then
        systemctl try-restart mcelog.service &> /dev/null
fi


This does not seem to be a big issue. Anyway it could be good to have this covered. Simple modification might do the job:

# Handle upgrading mcelog
if [ "$1" -ge 1 ]; then
        systemctl try-restart mcelog.service &> /dev/null || :
fi

Version-Release number of selected component (if applicable):
mcelog-3:101-3.9de4924.el7.x86_64

How reproducible:
upgrade of package (I did yum update)

Actual results:
rpm reports warning from postun

Expected results:
real issue fixed, harmless hidden
Comment 2 Prarit Bhargava 2016-05-16 08:49:28 EDT
(In reply to Marian Ganisin from comment #0)
> Description of problem:
> 
> During upgrade I see following message:
> 
> warning: %postun(mcelog-3:101-3.9de4924.el7.x86_64) scriptlet failed, exit
> status 1
> 
> 
> I briefly checked rpm scriptelts of mcelog-120-2.e7e0ac1.el7.x86_64.rpm (not
> the same version!) this piece of code might cause it:
> 
> # Handle upgrading mcelog
> if [ "$1" -ge 1 ]; then
>         systemctl try-restart mcelog.service &> /dev/null
> fi
> 
> 
> This does not seem to be a big issue. Anyway it could be good to have this
> covered. Simple modification might do the job:
> 
> # Handle upgrading mcelog
> if [ "$1" -ge 1 ]; then
>         systemctl try-restart mcelog.service &> /dev/null || :
> fi
> 
> Version-Release number of selected component (if applicable):
> mcelog-3:101-3.9de4924.el7.x86_64
> 
> How reproducible:
> upgrade of package (I did yum update)
> 
> Actual results:
> rpm reports warning from postun
> 
> Expected results:
> real issue fixed, harmless hidden


I just did

yum -y install mcelog (to get the latest released mcelog in 7.1) and followed that by a "manual" rpm -Uvh of the mcelog package from 7.2

I do *not* see this error.  Is there some magic to force this error?

P.
Comment 3 Marian Ganisin 2016-05-31 07:35:25 EDT
The mcelog.service has to be started, systemctl start mcelog.service after yum install is necessary.

Anyway I found that it does not seem to be possible to stop mcelog.service gracefully at all. Whenever I do systemctl stop mcelog.service it enters failed state due to returned exit-code:

● mcelog.service - Machine Check Exception Logging Daemon
   Loaded: loaded (/usr/lib/systemd/system/mcelog.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Út 2016-05-31 13:31:13 CEST; 2s ago
  Process: 10553 ExecStart=/usr/sbin/mcelog --ignorenodev --daemon --syslog (code=exited, status=0/SUCCESS)
  Process: 10551 ExecStartPre=/etc/mcelog/mcelog.setup (code=exited, status=0/SUCCESS)
 Main PID: 10555 (code=exited, status=15)

kvě 31 13:31:05 ibm-x3550m3-04-g2.lab.eng.brq.redhat.com systemd[1]: Starting Machine Check Exception Logging Daemon...
kvě 31 13:31:05 ibm-x3550m3-04-g2.lab.eng.brq.redhat.com systemd[1]: Started Machine Check Exception Logging Daemon.
kvě 31 13:31:13 ibm-x3550m3-04-g2.lab.eng.brq.redhat.com systemd[1]: Stopping Machine Check Exception Logging Daemon...
kvě 31 13:31:13 ibm-x3550m3-04-g2.lab.eng.brq.redhat.com systemd[1]: mcelog.service: main process exited, code=exited, status=15/n/a
kvě 31 13:31:13 ibm-x3550m3-04-g2.lab.eng.brq.redhat.com systemd[1]: Stopped Machine Check Exception Logging Daemon.
kvě 31 13:31:13 ibm-x3550m3-04-g2.lab.eng.brq.redhat.com systemd[1]: Unit mcelog.service entered failed state.
kvě 31 13:31:13 ibm-x3550m3-04-g2.lab.eng.brq.redhat.com systemd[1]: mcelog.service failed.

So systemctl stop mcelog.service might be real cause of this issue.
Comment 4 Martin Poole 2016-07-17 07:12:05 EDT
Would appear to need the '|| :' on all the systemctl entries (install & uninstall).
Comment 5 Prarit Bhargava 2016-08-09 09:23:33 EDT
(In reply to Martin Poole from comment #4)
> Would appear to need the '|| :' on all the systemctl entries (install &
> uninstall).

Tried that and it didn't work.  I think the issue is that the mcelog utility can return 15 as "SUCCESS" on shutdown, and that systemd expects to see 0.

mganisin, can you modify /usr/lib/systemd/system/mcelog.service

to include the SuccessExitStatus line below

[Service]
Type=forking
ExecStartPre=/etc/mcelog/mcelog.setup
ExecStart=/usr/sbin/mcelog --ignorenodev --daemon --syslog
SuccessExitStatus=0 15
StandardOutput=syslog

and try your test again?

Thanks,

P.
Comment 6 Prarit Bhargava 2016-08-23 10:46:06 EDT
ping?

P.
Comment 8 Marian Ganisin 2016-08-26 04:18:02 EDT
# systemctl start mcelog
# systemctl status mcelog
● mcelog.service - Machine Check Exception Logging Daemon
   Loaded: loaded (/usr/lib/systemd/system/mcelog.service; enabled; vendor preset: enabled)
   Active: active (running) since Pá 2016-08-26 04:15:58 EDT; 22s ago
 Main PID: 10486 (mcelog)
   CGroup: /system.slice/mcelog.service
           └─10486 /usr/sbin/mcelog --ignorenodev --daemon --syslog

srp 26 04:15:58 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Starting Machine Check Exception Logging Daemon...
srp 26 04:15:58 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Started Machine Check Exception Logging Daemon.
# systemctl stop mcelog
# systemctl status mcelog
● mcelog.service - Machine Check Exception Logging Daemon
   Loaded: loaded (/usr/lib/systemd/system/mcelog.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Pá 2016-08-26 04:16:30 EDT; 4s ago
 Main PID: 10486 (code=exited, status=15)

srp 26 04:15:58 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Starting Machine Check Exception Logging Daemon...
srp 26 04:15:58 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Started Machine Check Exception Logging Daemon.
srp 26 04:16:30 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Stopping Machine Check Exception Logging Daemon...
srp 26 04:16:30 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: mcelog.service: main process exited, code=exited, status=15/n/a
srp 26 04:16:30 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Stopped Machine Check Exception Logging Daemon.
srp 26 04:16:30 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Unit mcelog.service entered failed state.
srp 26 04:16:30 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: mcelog.service failed.
# sed -i '/\[Service\]/a SuccessExitStatus=0 15' /usr/lib/systemd/system/mcelog.service
# systemctl daemon-reload
# systemctl start mcelog
# systemctl status mcelog
● mcelog.service - Machine Check Exception Logging Daemon
   Loaded: loaded (/usr/lib/systemd/system/mcelog.service; enabled; vendor preset: enabled)
   Active: active (running) since Pá 2016-08-26 04:16:56 EDT; 3s ago
  Process: 10548 ExecStart=/usr/sbin/mcelog --ignorenodev --daemon --syslog (code=exited, status=0/SUCCESS)
  Process: 10545 ExecStartPre=/etc/mcelog/mcelog.setup (code=exited, status=0/SUCCESS)
 Main PID: 10550 (mcelog)
   CGroup: /system.slice/mcelog.service
           └─10550 /usr/sbin/mcelog --ignorenodev --daemon --syslog

srp 26 04:16:56 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Starting Machine Check Exception Logging Daemon...
srp 26 04:16:56 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Started Machine Check Exception Logging Daemon.
# systemctl stop mcelog
# systemctl status mcelog
● mcelog.service - Machine Check Exception Logging Daemon
   Loaded: loaded (/usr/lib/systemd/system/mcelog.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Pá 2016-08-26 04:17:05 EDT; 2s ago
  Process: 10548 ExecStart=/usr/sbin/mcelog --ignorenodev --daemon --syslog (code=exited, status=0/SUCCESS)
  Process: 10545 ExecStartPre=/etc/mcelog/mcelog.setup (code=exited, status=0/SUCCESS)
 Main PID: 10550 (code=exited, status=15)

srp 26 04:16:56 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Starting Machine Check Exception Logging Daemon...
srp 26 04:16:56 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Started Machine Check Exception Logging Daemon.
srp 26 04:17:05 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Stopping Machine Check Exception Logging Daemon...
srp 26 04:17:05 bkr-hv03-guest14.dsal.lab.eng.bos.redhat.com systemd[1]: Stopped Machine Check Exception Logging Daemon.
#
Comment 20 errata-xmlrpc 2017-08-01 08:46:31 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2218

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