Whenever updating apache2 with emerge -u, the file /usr/lib/apache2/build/envvars is overwritten. chmod 444 didn't also help. I use this file (I suppose it's the correct place) to give apache some environment, especially things like ORACLE_HOME, ORA_NLS33 and some locale stuff that is important for my application. Every time apache2 gets updated, the file's contents are lost. Each time I forget to care about that one file during system update, I get garbled database contents to clean up, which costs a lot of time. There's also a file envvars-std. I suggest updating this alone and preserving any non-equivalent contents of envvars, since this is already the place where to customize. Another solution would be to cover it as a normal configuration file which is then updated with etc-update. A third solution would be to move it to /etc/apache2/conf. Reproducible: Always Steps to Reproduce: 1. emerge -u apache2 2. ls -l /usr/lib/apache2/build/env* Portage 2.0.51.22-r2 (default-linux/x86/2005.0/2.4, gcc-3.3.5-20050130, glibc-2.3.5-r1, 2.4.28 i686) ================================================================= System uname: 2.4.28 i686 Pentium III (Coppermine) Gentoo Base System version 1.6.12 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.4.22-r1 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium3" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/fax /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind /var/qmail/control /var/service /var/spool/fax/etc" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium3" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/ ftp://gd.tuwien.ac.at/opsys/linux/gentoo/" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 X alsa apache2 apm arts avi berkdb bitmap-fonts bonobo cdr crypt cups curl dvd eds emboss encode esd f77 fam flac foomaticdb fortran gcj gd gdbm gif gnome gpm gstreamer gtk gtk2 gtkhtml imagemagick imlib ipv6 jack java jpeg junit kde ldap libg++ libwww mad matrox mbox mikmod mmx motif mozilla mp3 mpeg nas ncurses nls oci8 ogg oggvorbis opengl oss pam pdflib perl png postgres ppds python qt quicktime readline real ruby samba scanner sdl slang spell sse ssl svga tcltk tcpd tetex threads tiff truetype truetype-fonts type1-fonts usb vorbis xine xml xml2 xmms xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
I don't believe this file is meant to be user-edited, it's meant as a snapshot of the build environment. What documentation tells you to edit this file?
Michael, there was no specific documentation that would have told me. I found it while tracing the apache start script activity. I would be perfectly happy to have any other location where I could set environment variables for apache.
add the environment variables you want to keep to KEEPENV in /etc/conf.d/apache2, and then set the environment variables globally. Or (IIRC) you could set the environment variables in the /etc/conf.d/apache2 and export them - the file is simply a bash script.
I added the variables to /etc/conf.d/apache2 and added them to the new KEEPENV. That did it, thanks. Maik