Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 389805 - emerge -C dev-lang/php:5.2 silently removes /etc/apache2/modules.d/70_mod_php5.conf even if dev-lang/php:5.3 is installed
Summary: emerge -C dev-lang/php:5.2 silently removes /etc/apache2/modules.d/70_mod_php...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-07 12:30 UTC by Sergey S. Starikoff
Modified: 2013-03-23 19:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey S. Starikoff 2011-11-07 12:30:53 UTC
On last friday I have to installe for some test the php-5.2.
Later, I've rmoved it.
And just today discovered, that with removing of old masked php5, I've lost the necessary for normal operation of php-5.3 /etc/apache2/modules.d/70_mod_php5.conf.

Reproducible: Always

Steps to Reproduce:
1. Set up web-server (apache2 + php (now 5.3));
2. Unmask and install php-5.2 (also with apache module);
3. Switch back to php-5.3 and uninstall php-5.2
4. Restart web-server and try to open php-page.
Actual Results:  
Plain text because of missed module amd mime declaration from /etc/apache2/modules.d/70_mod_php5.conf.

Expected Results:  
1. Correct display of web page.

2. pkg_config target in dev-lang/php ebuild to restore missed file automatically without rebuilding of php.

Some similiar issue I've seen (but not reproduced) with /etc/env.d/50oracle-instantclient-basic

$ emerge --info
Portage 2.1.10.11 (default/linux/x86/10.0, gcc-4.5.3, glibc-2.12.2-r0, 3.0.6-gentoo i686)
=================================================================
System uname: Linux-3.0.6-gentoo-i686-Intel-R-_Pentium-R-_4_CPU_3.00GHz-with-gentoo-2.0.3
Timestamp of tree: Mon, 31 Oct 2011 00:45:01 +0000
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.1.4-r3
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.10.3, 1.11.1
sys-devel/binutils:       2.20.1-r1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories:

gentoo
    location: /usr/portage
    sync: rsync://mirror.yandex.ru/gentoo-portage/
    priority: -1000

local-portage-tree
    location: /usr/local/portage-ftn
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
ACCEPT_PROPERTIES="*"
ALSA_CARDS="intel8x0"
ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol"
APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias"
ARCH="x86"
AUTOCLEAN="yes"
CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump"
CAMERAS="ptp2"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
COLLISION_IGNORE="/lib/modules"
COLORTERM="Terminal"
CONFIG_PROTECT="/etc /etc/env.d/50glib2 /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe"
C_INCLUDE_PATH="/usr/lib/oracle/10.2.0.3/client/include"
DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-bxpCp5vmvg,guid=7f7df0012b297f79e98e9d5400000067"
DESKTOP_SESSION="xfce"
DISPLAY=":0.0"
DISTDIR="/var/distfiles"
EDITOR="/usr/bin/vim"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="--ask --verbose --autounmask=n"
EMERGE_WARNING_DELAY="10"
EPREFIX=""
EROOT="/"
FCFLAGS=""
FEATURES="assume-digests binpkg-logs buildsyspkg distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FETCHCOMMAND="/usr/bin/wget -t 5 -T 60 --passive-ftp --proxy-user=user --proxy-password=password -O "${DISTDIR}/${FILE}" "${URI}""
FETCHCOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""
FETCHCOMMAND_SFTP="bash -c "x=\${2#sftp://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec sftp -P \${port} \"\${host}:/\${x#*/}\" \"\$1\"" sftp "${DISTDIR}/${FILE}" "${URI}""
FETCHCOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}""
FFLAGS=""
GCC_SPECS=""
GDK_USE_XFT="1"
GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles/ 		ftp://mirror.yandex.ru/gentoo-distfiles/                 http://ftp.chg.ru/pub/Linux/distributions/gentoo/                 ftp://ftp.chg.ru/pub/Linux/distributions/gentoo/ 		http://ftp.corbina.net/pub/Linux/gentoo/ 		ftp://ftp.corbina.net/pub/Linux/gentoo/"
GLADE_CATALOG_PATH=":"
GLADE_MODULE_PATH=":"
GLADE_PIXMAP_PATH=":"
GPG_AGENT_INFO="/tmp/gpg-aqoXwM/S.gpg-agent:1666:1"
GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx"
GRUB_PLATFORMS=""
GSETTINGS_BACKEND="gconf"
G_BROKEN_FILENAMES="1"
G_FILENAME_ENCODING="KOI8-R"
HG="/usr/bin/hg"
HOME="/home/ftn"
INFOPATH="/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.20.1/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.5.3/info"
INPUT_DEVICES="keyboard mouse"
JAVAC="/etc/java-config-2/current-system-vm/bin/javac"
JAVA_HOME="/etc/java-config-2/current-system-vm"
JDK_HOME="/etc/java-config-2/current-system-vm"
KERNEL="linux"
LANG="ru_RU.KOI8-R"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LC_ALL=""
LC_NUMERIC="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LESS="-R -M --shift 5"
LESSOPEN="|lesspipe %s"
LIBGLADE_MODULE_PATH=":/usr/lib/libglade/2.0"
LINGUAS="ru"
LOGNAME="ftn"
LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:"
MAIL="/var/mail/ftn"
MAKEOPTS="-j2"
MANPATH="/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.20.1/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.5.3/man:/etc/java-config/system-vm/man/:/usr/lib/php5.3/man/"
NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"
NLS_LANG="russian_cis.cl8iso8859p5"
OPENGL_PROFILE="xorg-x11"
ORACLE_HOME="/usr/lib/oracle/10.2.0.3/client"
PAGER="/usr/bin/less"
PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.1.1:/usr/i686-pc-linux-gnu/gcc-bin/4.5.3:~/bin"
PHP_TARGETS="php5-3"
PKGDIR="/usr/portage/packages"
PORTAGE_ARCHLIST="ppc sparc64-freebsd ppc-openbsd x86-openbsd ppc64 x86-winnt x86-fbsd ppc-aix alpha arm x86-freebsd s390 amd64 arm-linux x86-macos x64-openbsd ia64-hpux hppa x86-netbsd x86-cygwin amd64-linux ia64-linux x86 sparc-solaris x64-freebsd sparc64-solaris x86-linux x64-macos sparc m68k-mint ia64 mips ppc-macos x86-interix hppa-hpux amd64-fbsd x64-solaris mips-irix m68k sh x86-solaris sparc-fbsd"
PORTAGE_BINHOST_CHUNKSIZE="3000"
PORTAGE_BIN_PATH="/usr/lib/portage/bin"
PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png"
PORTAGE_CONFIGROOT="/"
PORTAGE_DEBUG="0"
PORTAGE_DEPCACHEDIR="/var/cache/edb/dep"
PORTAGE_ELOG_CLASSES="log warn error"
PORTAGE_ELOG_MAILFROM="portage@localhost"
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}"
PORTAGE_ELOG_MAILURI="root"
PORTAGE_ELOG_SYSTEM="save_summary echo"
PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5"
PORTAGE_FETCH_RESUME_MIN_SIZE="350K"
PORTAGE_GID="250"
PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --clearsign --yes --default-key "${PORTAGE_GPG_KEY}" --homedir "${PORTAGE_GPG_DIR}" "${FILE}""
PORTAGE_INST_GID="0"
PORTAGE_INST_UID="0"
PORTAGE_NICENESS="13"
PORTAGE_PYM_PATH="/usr/lib/portage/pym"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_RSYNC_RETRIES="-1"
PORTAGE_SANDBOX_COMPAT_LEVEL="16"
PORTAGE_SYNC_STALE="30"
PORTAGE_TMPDIR="/var/tmp"
PORTAGE_VERBOSE="1"
PORTAGE_WORKDIR_MODE="0700"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage-ftn"
PRELINK_PATH_MASK="/usr/lib/libfreebl3.so:/usr/lib/libnssdbm3.so:/usr/lib/libsoftokn3.so"
PROFILE_ONLY_VARIABLES="ARCH ELIBC KERNEL USERLAND"
PWD="/home/ftn"
PYTHONDONTWRITEBYTECODE="1"
RESUMECOMMAND="/usr/bin/wget -c -t 5 -T 60 --passive-ftp --proxy-user=user --proxy-password=password -O "${DISTDIR}/${FILE}" "${URI}""
RESUMECOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""
RESUMECOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}""
ROOT="/"
ROOTPATH="/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.1.1:/usr/i686-pc-linux-gnu/gcc-bin/4.5.3"
RPMDIR="/usr/portage/rpm"
RUBY_TARGETS="ruby18"
SESSION_MANAGER="/tmp/.ICE-unix/1675"
SHELL="/bin/bash"
SHLVL="3"
SSH_AGENT_PID="1666"
SSH_AUTH_SOCK="/tmp/gpg-LbO9Gb/S.gpg-agent.ssh"
SUPPORT_ALSA="1"
SYNC="rsync://mirror.yandex.ru/gentoo-portage/"
TERM="xterm"
TNS_ADMIN="/etc/oracle/"
USE="X a52 ac3 acl alsa avi berkdb bold bzip2 cdr cli cracklib crypt cups cxx dbus djvu dri dvd flac fortran gdbm gif gtk iconv jpeg jpeg2k modules mp3 mudflap ncurses nls nptl nptlonly ogg openmp pam pcre pdf png pppd qt3support readline session ssl sysfs tcpd tiff unicode utf8 vorbis x86 xcb xorg xulrunner zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="sis" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USER="ftn"
USERLAND="GNU"
USE_EXPAND="ALSA_CARDS ALSA_PCM_PLUGINS APACHE2_MODULES APACHE2_MPMS CALLIGRA_FEATURES CAMERAS COLLECTD_PLUGINS CROSSCOMPILE_OPTS DRACUT_MODULES DVB_CARDS ELIBC FCDSL_CARDS FOO2ZJS_DEVICES FRITZCAPI_CARDS GPSD_PROTOCOLS GRUB_PLATFORMS INPUT_DEVICES KERNEL LCD_DEVICES LINGUAS LIRC_DEVICES MISDN_CARDS NETBEANS_MODULES NGINX_MODULES_HTTP NGINX_MODULES_MAIL OFED_DRIVERS PHP_TARGETS QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS RUBY_TARGETS SANE_BACKENDS USERLAND VIDEO_CARDS XFCE_PLUGINS XTABLES_ADDONS"
USE_EXPAND_HIDDEN="CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"
USE_ORDER="env:pkg:conf:defaults:pkginternal:repo:env.d"
VIDEO_CARDS="sis"
WINDOWID="58720260"
WWW_HOME="www.ya.ru"
XAUTHORITY="/home/ftn/.Xauthority"
XDG_CONFIG_DIRS="/etc/xdg:/etc/xdg"
XDG_DATA_DIRS="/usr/local/share:/usr/share:/usr/share"
XDG_MENU_PREFIX="xfce-"
XSESSION="Xfce4"
XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
_="/usr/bin/emerge"
Comment 1 Marcin Mirosław 2011-11-08 15:24:57 UTC
Yeah, i've got similar situation. Php5.2 is almost dead but we going to have php5.4 and problem will back again.
Comment 2 Ole Markus With (RETIRED) gentoo-dev 2011-11-09 10:27:35 UTC
I tried to reproduce this, but both with Portage 2.1 and Portage 2.2, the file is kept after removing a slot when multiple slots are built with the apache2 USE flag.

The file gets removed when I unmerge the last installed slot.
Comment 3 Marcin Mirosław 2011-11-09 10:59:56 UTC
My version "how to reproduce problem" is:
a) USE="apache2" emerge php:5.3
$ ls -l /etc/apache2/modules.d/70_mod_php5.conf 
-rw-r--r-- 1 root root 348 11-09 11:53 /etc/apache2/modules.d/70_mod_php5.conf

b) USE="apache2" emerge php:5.2 
$ ls -l /etc/apache2/modules.d/70_mod_php5.conf 
-rw-r--r-- 1 root root 348 11-09 11:55 /etc/apache2/modules.d/70_mod_php5.conf

(we can see time of modification is changed)

c) hmm, no, i don't need php5.2, let me uninstall it
# emerge -C php:5.2
$ ls -l /etc/apache2/modules.d/70_mod_php5.conf 
ls: cannot access /etc/apache2/modules.d/70_mod_php5.conf: No such file or directory

Ups, apache will not work after reload/restart.
Comment 4 Ole Markus With (RETIRED) gentoo-dev 2011-11-09 11:52:24 UTC
I can reproduce the problem with 5.2 and 5.3, but not with 5.3 and 5.4. 

Would you be able to test this?
Comment 5 Sergey S. Starikoff 2011-11-09 12:00:37 UTC
(In reply to comment #4)
> I can reproduce the problem with 5.2 and 5.3, but not with 5.3 and 5.4. 
> 
To my mind it's so because of mask handling (in the case 5.2 and 5.3 now 5.2 is masked; in the case 5.3 and 5.4 5.3 is not masked).
Comment 6 Marcin Mirosław 2011-11-09 12:08:57 UTC
I've done:
- emerge php:5.3
- emerge php:5.4
- emerge -C php:5.4

and i got:
$ ls -l /etc/apache2/modules.d/70_mod_php5.conf 
ls: cannot access /etc/apache2/modules.d/70_mod_php5.conf: No such file or directory
Comment 7 Ole Markus With (RETIRED) gentoo-dev 2011-11-09 12:27:47 UTC
(In reply to comment #6)
> I've done:
> - emerge php:5.3
> - emerge php:5.4
> - emerge -C php:5.4
> 
> and i got:
> $ ls -l /etc/apache2/modules.d/70_mod_php5.conf 
> ls: cannot access /etc/apache2/modules.d/70_mod_php5.conf: No such file or
> directory

How about when you remove 5.3 instead? Maybe that is why I could not reproduce it earlier, because I removed the non-masked package.

If so, this problem is more about portage behaviour than a bug in the PHP ebuild. And I do not really know of any way of fixing this.
Comment 8 Marcin Mirosław 2011-11-09 12:54:37 UTC
Problem appears when you uninstall latest installed php.
When php:5.FOO installs mod_php5 this file has checksumm XYZXYZ, then we install php:5.BAR . File mod_php5 wasn't changed mannualy so portage overwrites using file from new version of php (php:5.BAR). Now if we remove php:5.FOO portage will not delete mod_php5 because checksum/timestamp was changed but when we do emerge -C php:5.BAR those file will be deleted.
It could be hard to do with portage without using diffrent name of file which loads php. Quick proposals:
- every php slot should install file with diffrent name (mod_php5.FOO.conf)
then apache complians when we try to reload-> let user fix problem
- eselect php set apache2 should create this file from template
portage will not even know that such file exists->it will not remove it.
- as you standed earlier let portage's team do some magic :)
Comment 9 Ole Markus With (RETIRED) gentoo-dev 2011-11-09 13:19:35 UTC
Good to know about this. I am not sure if any of the proposed solutions are good enough. It is the first time I have heard about this issue and we have had multiple slots in portage for quite some time now. I'll see if anyone in the herd can come up with some other solutions.
Comment 10 Sergey S. Starikoff 2011-11-10 06:00:25 UTC
(In reply to comment #9)
> It is the first time I have heard about this issue and we have had
> multiple slots in portage for quite some time now. 
I can say why it is so:
1. To my experience many (most) multi-slot packages are libraries (have no commonly used files);
2. In the listed case (php): the issue doesn't appear in normal evalution (upgrade and remove outdated version).

For this case (php) I can suggest the following workaround:
1. Make problem file (70_mod_php5.conf) slot-depended. Like it is done for config files in /etc/php/.
I.e. 70_mod_php5-2.conf, 70_mod_php5-3.conf, 70_mod_php5-4.conf and so long.
2. Make apache php include directive also slot-depended.
I.e. instead "-D PHP5" use "-D PHP5_2", "-D PHP5_3", "-D PHP5_4" and so long.
3. Make eselect php apache to update APACHE2_OPTS in /etc/conf.d/apache2 (or remind user to do it).

But I think it will be good to think about question of file collisions (and common usage of some files by packages from different slots.
I was not very pleased, when find that command line tools for openssl from 0.9.8 slot are unavailable.
Comment 11 Ole Markus With (RETIRED) gentoo-dev 2011-11-10 07:39:46 UTC
Thanks for the input, guys. See my concerns above.

(In reply to comment #8)
> - every php slot should install file with diffrent name (mod_php5.FOO.conf)
> then apache complians when we try to reload-> let user fix problem

Will apache complain? I think it will just silently use the lowest PHP version due to file name sorting. There are IF statements in the configs that ensures PHP is only loaded once.

So the outcome might be that the user is unaware that he needs to clean up the apache modules dir. Changing PHP slot would also be a bit troublesome.

> - eselect php set apache2 should create this file from template
> portage will not even know that such file exists->it will not remove it.

I am generally not a big fan of adding files outside of portage. It is possible to let eselect-php handle the file completely, including removing it in pkg_postrm if the last slot with apache2 was removed. This would require a bit of work and a bit of magic, out of which a lot can go wrong.

> - as you standed earlier let portage's team do some magic :)

I do not think this one is feasible in the near future.

(In reply to comment #10)
> For this case (php) I can suggest the following workaround:
> 1. Make problem file (70_mod_php5.conf) slot-depended. Like it is done for
> config files in /etc/php/.
> I.e. 70_mod_php5-2.conf, 70_mod_php5-3.conf, 70_mod_php5-4.conf and so long.
> 2. Make apache php include directive also slot-depended.
> I.e. instead "-D PHP5" use "-D PHP5_2", "-D PHP5_3", "-D PHP5_4" and so long.
> 3. Make eselect php apache to update APACHE2_OPTS in /etc/conf.d/apache2 (or
> remind user to do it).

This one is not too bad. The downside is that mod_php is no longer controlled by eselect-php, but in my mind, that is not a big problem.

Users who try to add multiple -D PHP5* would suffer the same consequence as the first proposal of comment 8.
Comment 12 Sergey S. Starikoff 2012-10-11 05:24:40 UTC
Caught the same issue while testing on upgrade from 5.3 to 5.4.


(In reply to comment #11)
> > For this case (php) I can suggest the following workaround:
> > 1. Make problem file (70_mod_php5.conf) slot-depended. Like it is done for
> > config files in /etc/php/.
> > I.e. 70_mod_php5-2.conf, 70_mod_php5-3.conf, 70_mod_php5-4.conf and so long.
> > 2. Make apache php include directive also slot-depended.
> > I.e. instead "-D PHP5" use "-D PHP5_2", "-D PHP5_3", "-D PHP5_4" and so long.
> > 3. Make eselect php apache to update APACHE2_OPTS in /etc/conf.d/apache2 (or
> > remind user to do it).
> 
> This one is not too bad. The downside is that mod_php is no longer
> controlled by eselect-php, but in my mind, that is not a big problem.
> 
Issued file (/etc/apache2/modules.d/70_mod_php5.conf) belongs to last installed version of dev-lang/php (for me now it is dev-lang/php-5.4.6).

So, excluding this file from dev-lang/php package list will solve the issue.
If there is no compatibility issues (the same 70_mod_php5.conf is compatible with all available versions of dev-lang/php).
It could be done for example by adding to app-admin/eselect-php package apache2 USE flag, installing 70_mod_php5.conf file.
Comment 13 Ole Markus With (RETIRED) gentoo-dev 2012-10-11 18:57:42 UTC
I will see if I have the time to implement that for the bump after this one.
Comment 14 Sergey S. Starikoff 2012-10-12 06:08:36 UTC
(In reply to comment #13)
> I will see if I have the time to implement that for the bump after this one.

Thank you!

I've thought a little bit more... :)
And find one more, looking to be better solution:

1. Regular config file name belongs each to a proper php version and placed into /etc/php/apache2-php5.N/ directory.
Possiblely with correcting of filename (from source 70_mod_php5.conf to 70_mod_php5.N.conf).
2. Apache still uses /etc/apache2/modules.d/70_mod_php5.conf.
3. Apache's conf file belongs to app-admin/eselect-php (depending on added to this package apache2 USE).
4. The /etc/apache2/modules.d/70_mod_php5.conf is eselect php apache2 module's managed symbolic link, pointing on a proper /etc/php/apache2-php5.N/70_mod_php5.N.conf regular config file.

So, different sl;ot-available versions of dev-lang/php could use incompatible (different) Apache's 70_mod_php5.conf files.
Comment 15 Ole Markus With (RETIRED) gentoo-dev 2012-10-12 06:26:12 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > I will see if I have the time to implement that for the bump after this one.
> 
> So, different sl;ot-available versions of dev-lang/php could use
> incompatible (different) Apache's 70_mod_php5.conf files.

That would certainly complicate setup. Do you have any examples of how 70_mod_php5.conf could be different between slots from upstream's perspective? I can see that users may want different files, but once users start messing with configs, that is out of the scope of what we try to do.
Comment 16 Sergey S. Starikoff 2012-10-16 08:58:30 UTC
(In reply to comment #15)
> That would certainly complicate setup.
It will complicate coding this feature.
Server setup will be unchanged.

> Do you have any examples of how 70_mod_php5.conf could be different between
> slots from upstream's perspective?
No.
It was just thinking about common solution.

> I can see that users may want different files, but once users
> start messing with configs, that is out of the scope of what we try to do.
To my mind the provided mechanism should be operable both with default and user-changed configs.

The easiest (first suggested) solution (adding apache2 use flag to app-admin/eselect-php with moving 70_mod_php5.conf to this package, or even moving apache2 flag from dev-lang/php to app-admin/eselect-php) looks to be good enough.
Comment 17 Ole Markus With (RETIRED) gentoo-dev 2013-03-23 19:47:28 UTC
the fpm and apache2 files have been moved to eselect-php so this should no longer be an issue.