1 (edited by TomaszN 2017-10-09 16:57:57)

Topic: Bug in php56-runtime 2.3-1.el7 @remi-safe ?

I'm unable to upgrade package php56-runtime from remi-save repository.

# yum upgrade
...
================================================================================
 Package             Arch         Version                 Repository       Size
================================================================================
Updating:
 php56-runtime       x86_64       2.3-1.el7.remi          remi-safe       1.1 M

Transaction Summary
================================================================================
Upgrade  1 Package

Total download size: 1.1 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
php56-runtime-2.3-1.el7.remi.x86_64.rpm                    | 1.1 MB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : php56-runtime-2.3-1.el7.remi.x86_64                          1/2
Error unpacking rpm package php56-runtime-2.3-1.el7.remi.x86_64
error: unpacking of archive failed on file /etc/opt/remi/php56: cpio: rename
php56-runtime-2.1-5.el7.remi.x86_64 was supposed to be removed but is not!
  Verifying  : php56-runtime-2.1-5.el7.remi.x86_64                          1/2
  Verifying  : php56-runtime-2.3-1.el7.remi.x86_64                          2/2

Failed:
  php56-runtime.x86_64 0:2.1-5.el7.remi  php56-runtime.x86_64 0:2.3-1.el7.remi

I store configs in /etc/opt/remi/php56 as I prefer this to /opt location.

# ls -al /etc/opt/remi/php56
total 96
drwxr-xr-x 4 root root  4096 Apr 26  2016 .
drwxr-xr-x 3 root root  4096 Oct  9 18:40 ..
drwxr-xr-x 2 root root  4096 Oct  8 04:24 php.d
-rw-r----- 1 root root  4128 Mar 31  2016 php-fpm.conf
drwxr-xr-x 2 root root  4096 Jul 18 02:48 php-fpm.d
-rw-r----- 1 root root 72425 Apr 26  2016 php.ini

Every failed upgrade of php56-runtime ends with yet another symbolic link in /etc/opt/remi:

# ls -al /etc/opt/remi/
total 12
drwxr-xr-x  3 root root 4096 Oct  9 18:40 .
drwxr-xr-x. 3 root root 4096 Nov  5  2016 ..
drwxr-xr-x  4 root root 4096 Apr 26  2016 php56
lrwxrwxrwx  1 root root   24 Oct  8 04:23 php56;59d98b0d -> /opt/remi/php56/root/etc
lrwxrwxrwx  1 root root   24 Oct  8 04:29 php56;59d98d83 -> /opt/remi/php56/root/etc
lrwxrwxrwx  1 root root   24 Oct  8 04:32 php56;59d98e4e -> /opt/remi/php56/root/etc
lrwxrwxrwx  1 root root   24 Oct  9 18:34 php56;59dba51e -> /opt/remi/php56/root/etc
lrwxrwxrwx  1 root root   24 Oct  9 18:40 php56;59dba689 -> /opt/remi/php56/root/etc

Is this a bug?
Shouldn't package installer handle this somehow?
I do I fix this keeping my configs under /etc structure?
Thanks in advance.

Re: Bug in php56-runtime 2.3-1.el7 @remi-safe ?

What is the /etc/opt/remi/php56 directory ?

Indeed, the new php56-runtime comes with a link to /opt/remi/php56/root/etc so all collections can be used the same way (php56 still have the old layout)

ie: /etc/opt/remi/php*/php.ini

> Shouldn't package installer handle this somehow?

RPM can't handle such situation. BTW better to fail than destroy your data.


P.S. in short, the new php56-runtime does the same thing you have done differently.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Bug in php56-runtime 2.3-1.el7 @remi-safe ?

Remi wrote:

What is the /etc/opt/remi/php56 directory ?

I store all relevant configs there. I prefer to store them under /etc/opt/ then under /opt to have all configuration in one place (easier to backup, etc).

# ls -al /etc/opt/remi/*
/etc/opt/remi/php54:
total 88
drwxr-xr-x 4 root root  4096 Apr 16  2016 .
drwxr-xr-x 6 root root  4096 Oct  8 04:56 ..
drwxr-xr-x 2 root root  4096 Oct  8 04:29 php.d
-rw-r----- 1 root root  1796 Mar 30  2016 php-fpm.conf
drwxr-xr-x 2 root root  4096 Feb 19  2017 php-fpm.d
-rw-r----- 1 root root 65590 Apr 16  2016 php.ini

/etc/opt/remi/php55:
total 88
drwxr-xr-x 4 root root  4096 Apr 16  2016 .
drwxr-xr-x 6 root root  4096 Oct  8 04:56 ..
drwxr-xr-x 2 root root  4096 Oct  8 04:29 php.d
-rw-r----- 1 root root  3847 Mar 29  2016 php-fpm.conf
drwxr-xr-x 2 root root  4096 Feb 19  2017 php-fpm.d
-rw-r----- 1 root root 69397 Apr 16  2016 php.ini

/etc/opt/remi/php56:
total 96
drwxr-xr-x 4 root root  4096 Apr 16  2016 .
drwxr-xr-x 6 root root  4096 Oct  8 04:56 ..
drwxr-xr-x 2 root root  4096 Oct  8 04:35 php.d
-rw-r----- 1 root root  4128 Mar 31  2016 php-fpm.conf
drwxr-xr-x 2 root root  4096 Jul 18 03:09 php-fpm.d
-rw-r----- 1 root root 72394 Apr 16  2016 php.ini

/etc/opt/remi/php70:
total 124
drwxr-xr-x 12 root root  4096 Oct  8 04:36 .
drwxr-xr-x  6 root root  4096 Oct  8 04:56 ..
drwxr-xr-x  2 root root  4096 Jun  8  2016 opt
drwxr-xr-x  2 root root  4096 Oct  8 04:35 php.d
-rw-r--r--  1 root root  4104 Sep 26 16:47 php-fpm.conf
drwxr-xr-x  2 root root  4096 Sep 26 16:47 php-fpm.d
-rw-r-----  1 root root 69052 Apr 16  2016 php.ini
drwxr-xr-x  2 root root  4096 Jun  8  2016 pki
drwxr-xr-x  5 root root  4096 Jun  8  2016 pm
drwxr-xr-x  2 root root  4096 Jun  8  2016 skel
drwxr-xr-x  2 root root  4096 Oct  8 04:36 sysconfig
drwxr-xr-x  4 root root  4096 Jun  8  2016 X11
drwxr-xr-x  3 root root  4096 Jun  8  2016 xdg
drwxr-xr-x  2 root root  4096 Jun  8  2016 xinetd.d
Remi wrote:

RPM can't handle such situation. BTW better to fail than destroy your data.

P.S. in short, the new php56-runtime does the same thing you have done differently.

Is there any way I could keep configs under /etc/opt and "fix" this php56-runtime upgrade ?

As I see every failed upgrade creates link to /opt/remi/php56/root/etc

# ls -al /etc/opt/remi/php56*
lrwxrwxrwx 1 root root   24 Oct  8 04:33 /etc/opt/remi/php56;59d98bd0 -> /opt/remi/php56/root/etc
lrwxrwxrwx 1 root root   24 Oct  8 04:56 /etc/opt/remi/php56;59d993bd -> /opt/remi/php56/root/etc

/etc/opt/remi/php56:
total 96
drwxr-xr-x 4 root root  4096 Apr 16  2016 .
drwxr-xr-x 6 root root  4096 Oct  8 04:56 ..
drwxr-xr-x 2 root root  4096 Oct  8 04:35 php.d
-rw-r----- 1 root root  4128 Mar 31  2016 php-fpm.conf
drwxr-xr-x 2 root root  4096 Jul 18 03:09 php-fpm.d
-rw-r----- 1 root root 72394 Apr 16  2016 php.ini

and then in /opt/remi/php56/root/etc there are links back:

]# l /opt/remi/php56/root/etc
total 48
drwxr-xr-x 11 root root 4096 Jul 18 03:04 .
dr-xr-xr-x 16 root root 4096 Apr 16  2016 ..
drwxr-xr-x  2 root root 4096 Mar 10  2016 opt
drwxr-xr-x  2 root root 4096 Jun 29 06:42 pear
-rw-r--r--  1 root root 1441 Jun 29 06:42 pear.conf
lrwxrwxrwx  1 root root   25 Apr 16  2016 php.d -> /etc/opt/remi/php56/php.d
lrwxrwxrwx  1 root root   32 Apr 16  2016 php-fpm.conf -> /etc/opt/remi/php56/php-fpm.conf
lrwxrwxrwx  1 root root   29 Apr 16  2016 php-fpm.d -> /etc/opt/remi/php56/php-fpm.d
lrwxrwxrwx  1 root root   27 Apr 16  2016 php.ini -> /etc/opt/remi/php56/php.ini
drwxr-xr-x  2 root root 4096 Mar 10  2016 pki
drwxr-xr-x  5 root root 4096 Apr 16  2016 pm
drwxr-xr-x  2 root root 4096 Mar 10  2016 skel
drwxr-xr-x  2 root root 4096 Jul 18 03:05 sysconfig
drwxr-xr-x  4 root root 4096 Apr 16  2016 X11
drwxr-xr-x  3 root root 4096 Apr 16  2016 xdg
drwxr-xr-x  2 root root 4096 Mar 10  2016 xinetd.d

I'm confused..

Re: Bug in php56-runtime 2.3-1.el7 @remi-safe ?

1: save tour configuration files

2: delete the directory and the symlinks  (= switch back To the default layout)

3: update

4: restore (if needed) your files

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Bug in php56-runtime 2.3-1.el7 @remi-safe ?

Thanks Remi. I've done this and it worked.
Btw; it seems that php70 has a diffent layout (configs in /etc/opt, logs in /var/opt) and I was trying to follow it with php56.
It would be great if all version had this same layout

Re: Bug in php56-runtime 2.3-1.el7 @remi-safe ?

> Btw; it seems that php70 has a diffent layout (configs in /etc/opt, logs in /var/opt) and I was trying to follow it with php56.

Indeed.

Old collections use the old layout (not FHS compliant)
New collections use the new layout (which is now FHS compliant)

The reason why I've added the symlink in the php56 to be able to use same path everywhere.

I doesn't seems possible to change layout of the old collections, especially when the simple "symlink" way already raise this issue wink

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

7 (edited by TomaszN 2017-10-15 17:09:01)

Re: Bug in php56-runtime 2.3-1.el7 @remi-safe ?

Ok, I understand that.
I wrote a small script that I will be using to correct this manually smile

#
# etc
#
# remove symbolic link from etc & create directory instead
rm -f /etc/opt/remi/php56; mkdir -p /etc/opt/remi/php56
# move contents from opt to etc
mv /opt/remi/php56/root/etc/* /etc/opt/remi/php56/
# remove original directory from opt and create link to etc
rm -rf /opt/remi/php56/root/etc; ln -s /etc/opt/remi/php56 /opt/remi/php56/root/etc
#
# var
#
# remove symbolic link from var & create directory instead
rm -f /var/opt/remi/php56; mkdir -p /var/opt/remi/php56
# move contents from opt to var
mv /opt/remi/php56/root/var/* /var/opt/remi/php56/
# remove original directory from opt and create link to var
rm -rf /opt/remi/php56/root/var ln -s /var/opt/remi/php56 /opt/remi/php56/root/var
# create additional var/log and var/run subdirectories
mkdir -p /var/opt/remi/php56/{log,run}/php-fpm

Re: Bug in php56-runtime 2.3-1.el7 @remi-safe ?

Having the symlink from the new php56-runtime isn't enough ?

$ ll /etc/opt/remi/php*/php.ini
-rw-r--r--. 1 root root 67145  6 juil. 07:06 /etc/opt/remi/php56/php.ini
-rw-r--r--. 1 root root 60606 10 oct.  16:03 /etc/opt/remi/php70/php.ini
-rw-r--r--. 1 root root 62394 11 oct.  07:10 /etc/opt/remi/php71/php.ini
-rw-r--r--. 1 root root 62221 10 oct.  12:52 /etc/opt/remi/php72/php.ini
Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Bug in php56-runtime 2.3-1.el7 @remi-safe ?

I use a backup tool that would only backup the symlink then, not the target