Bug 1257116

Summary: warning: %postun(mcelog-3:101-3.9de4924.el7.x86_64) scriptlet failed, exit status 1
Product: Red Hat Enterprise Linux 7 Reporter: Marian Ganisin <mganisin>
Component: mcelogAssignee: Prarit Bhargava <prarit>
Status: CLOSED ERRATA QA Contact: Andrej Manduch <amanduch>
Severity: high Docs Contact:
Priority: urgent    
Version: 7.2CC: jwalter, mganisin, mmatsuya, mpoole, wlehman
Target Milestone: rcKeywords: ZStream
Target Release: 7.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 12:46:31 UTC Type: Bug
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: 1353018, 1388427, 1446211    

Description Marian Ganisin 2015-08-26 10:10:24 UTC
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 12:49:28 UTC
(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 11:35:25 UTC
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 11:12:05 UTC
Would appear to need the '|| :' on all the systemctl entries (install & uninstall).

Comment 5 Prarit Bhargava 2016-08-09 13:23:33 UTC
(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 14:46:06 UTC
ping?

P.

Comment 8 Marian Ganisin 2016-08-26 08:18:02 UTC
# 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 12:46:31 UTC
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