In /etc/init.d/apache2, the environment is cleared and PATH added to the new process executing apache. I think that the KRB5_KTNAME variable should also be preserved in this way, since it allows one to easily specify a seperate keytab for Apache, when used with mod_auth_kerb >=5. The system default keytab normally cannot be used by apache, since it shouldn't be readable by anyone but root. KRB5_KTNAME can then easily be defined in /etc/conf.d/apache2. Specifying a keytab _can_ also be done with a configuration directive to mod_auth_kerb, but that doesn't work very well, since it has to be specified for each and every directory (and in each .htaccess). Whether this behavior is a bug or intended I don't know, but allowing KRB5_KTNAME to be passed through would allow for both behaviors either way.
Created attachment 49152 [details, diff] This patch changes /etc/init.d/apache2 to preserve KRB5_KTNAME.
There's an even greater problem here. The /etc/init.d/apache2 from apache-2.0.53 has this: start() { checkconfig || return 1 ebegin "Starting apache2" [ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache [ -f /usr/lib/apache2/build/envvars ] && . /usr/lib/apache2/build/envvars ${APACHE2} ${APACHE2_OPTS} -k start eend $? } Sourcing /usr/lib/apache2/build/envvars in start() is futile if ${APACHE2} has "env -i ..." in it.
*** This bug has been marked as a duplicate of 92891 ***