Bug 1548331

Summary: ldconfig changes breaks package
Product: [Fedora] Fedora Reporter: Terje Røsten <terje.rosten>
Component: community-mysqlAssignee: Michal Schorm <mschorm>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: hhorak, jstanek, mschorm, ngompa13
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: community-mysql-5.7.21-6.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-11 22:18:35 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:

Description Terje Røsten 2018-02-23 08:45:30 UTC
Something went wrong during https://src.fedoraproject.org/cgit/rpms/community-mysql.git/commit/?id=d70e481fb94ffc9f282a5a11e69007cbe77af013

$ rpm --scripts -qp community-mysql-server-5.7.21-3.fc28.x86_64.rpm |cat -n
     1  preinstall scriptlet (using /bin/sh):
     2  /usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || :
     3  /usr/sbin/useradd -M -N -g mysql -o -r -d /var/lib/mysql -s /sbin/nologin \
     4    -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || :
     5  
     6  # Can be dropped on F27 EOL
     7   libs
     8  
     9  # Can be dropped on F27 EOL
    10   embedded
    11  postinstall scriptlet (using /bin/sh):
    12  
    13  if [ $1 -eq 1 ] ; then 
    14          # Initial installation 
    15          systemctl --no-reload preset mysqld.service >/dev/null 2>&1 || : 
    16  fi 
    17  
    18  if [ ! -e "/var/log/mysqld.log" -a ! -h "/var/log/mysqld.log" ] ; then
    19      install /dev/null -m0640 -omysql -gmysql "/var/log/mysqld.log"
    20  fi
    21  preuninstall scriptlet (using /bin/sh):
    22  
    23  if [ $1 -eq 0 ] ; then 
    24          # Package removal, not upgrade 
    25          systemctl --no-reload disable --now mysqld.service > /dev/null 2>&1 || : 
    26  fi 
    27  
    28  
    29  # Can be dropped on F27 EOL
    30   libs
    31  
    32  # Can be dropped on F27 EOL
    33   embedded
    34  postuninstall scriptlet (using /bin/sh):
    35  
    36  if [ $1 -ge 1 ] ; then 
    37          # Package upgrade, not uninstall 
    38          systemctl try-restart mysqld.service >/dev/null 2>&1 || : 
    39  fi


Lines 6-10 and 29-33 should not be present.

Comment 1 Michal Schorm 2018-02-23 09:05:57 UTC
> Lines 6-10 and 29-33 should not be present.

Any reason why they shouldn't ?

--

From the discussion on fedora-devel I understood, those macros are no-op on Fedora >= 28.

On F<=27 I replaced them with the new form, which should expand to the exact same string.

--

https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets

Comment 2 Terje Røsten 2018-02-23 09:21:01 UTC
I am sorry, I was a bit short. The problem is line 7, 10 and 30,33:

libs
embedded

these are no valid bash commands and postin scripts fails:

rpm --scripts  -Uvh community-mysql-server-5.7.21-3.fc28.x86_64.rpm 
Preparing...                          ################################# [100%]
/var/tmp/rpm-tmp.2gydaW: line 6: libs: command not found
/var/tmp/rpm-tmp.2gydaW: line 9: embedded: command not found
error: %prein(community-mysql-server-5.7.21-3.fc28.x86_64) scriptlet failed, exit status 127
error: community-mysql-server-5.7.21-3.fc28.x86_64: install failed
error: community-mysql-server-5.7.21-1.fc28.x86_64: erase skipped

I would guess

%ldconfig_post expands to nothing and then rest of line is left alone,
being libs or embedded.

Seems to me like:

 https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets

don't describe how this should work when used on sub package.

Added owners of feature to CC.

Comment 4 Igor Gnatenko 2018-02-25 06:12:46 UTC
Once it will be available in buildroot I will write here and will ask you to rebuild your package.

Comment 5 Igor Gnatenko 2018-02-25 06:52:31 UTC
Michal, please rebuild your package and everything should be good.

Comment 6 Terje Røsten 2018-02-25 09:58:23 UTC
Thanks Igor!

This package uses special location %{_libdir}/mysql  for so files,
is file triggers smart enough to understand this or must the
legacy scriptlets be restored to cover such case?

Comment 7 Michal Schorm 2018-02-25 11:12:10 UTC
Rebuilds for both MySQL and MariaDB for both Rawhide and F28 are on the way.

Hope I won't hit any problems with them. One way or another, they are my priority now.

--

From the IRC: (for future reference)

<mschorm>
Should I also rebuild all of my packages that could possibly have the same issue?
<ignatenkobrain>
Only %ldconfig_post/%ldconfig_postun are affected, %ldconfig_scriptlets is not.

Comment 8 Igor Gnatenko 2018-02-25 16:33:56 UTC
Btw, Michal..

Your scriptlets are wrong.

you should not use %ldconfig*, because you use ld.so.conf and guidelines say to handle that by old-style %post/%postun.

Comment 9 Michal Schorm 2018-02-27 23:39:27 UTC
(In reply to Igor Gnatenko from comment #8)
> you should not use %ldconfig*, because you use ld.so.conf and guidelines say
> to handle that by old-style %post/%postun.

Alright. I was too active.
I reverted the whole stuff for community-mysql, while leaving it in mariadb.

community-mysql packages are build now for all Fedora versions, so only BODHI should slow them down, now.

Comment 10 Fedora Update System 2018-02-27 23:41:50 UTC
community-mysql-5.7.21-6.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-ed0277d513

Comment 11 Fedora Update System 2018-02-28 18:09:33 UTC
community-mysql-5.7.21-6.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-ed0277d513

Comment 12 Fedora Update System 2018-03-11 22:18:35 UTC
community-mysql-5.7.21-6.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.