[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#697465: apache2.2-common: initial install fails: Could not read /etc/apache2/envvars

On Mon, 7 Jan 2013, Jonas Smedegaard wrote:

Quoting Jean-Michel Vourgère (2013-01-07 16:58:08)
On Sunday 06 January 2013 11:29:55 Arno Töll wrote:
Seems that error comes from a2ensite call, so I suspect the cause
might be some dependency of that script has not yet been

a2ensite does not call a shell to read /etc/apache2/envvars. Your
output makes me suspect this is rather coming from the init script
which is invoked from postinst. What makes you think a2ensite is the

a2ensite reads /etc/apache2/envvars in function read_env_file on line
env - sh -c '. /etc/apache2/envvars && env'

Thanks, Jean-Michel.

Sorry if I was unclear earlier: I am talking about postinst too:
postinst calls a2ensite calls perl loads modules.

Since those modules are not yet configured, postinst fails.

Are you sure? Perl modules usually don't need the package to be configured in order to be usable. An exception may be if ld.config needs to be called.

And even so, according to policy 7.2, the dependencies *will* be configured when postinst is run:

"In the case of `postinst configure', the depended-on packages will be unpacked and configured first. (If both packages are involved in a dependency loop, this might not work as expected; see the explanation a few paragraphs back.)"

Clearly perl-modules is not in a dependency loop with apache2.2-common. Perl-modules is priority standard, apache2.2-common is optional.

Package needs to pre-depend on perl, not just depend on it.

Below test indicates that this bug is independent from that lack of
predependency on perl - so do you guys want me to file a separate bug
about the perl predependency?

If you still think there is a bug, yes please. But include the exact error message.

What does the command line above yield?
What is the result code ? ($?)
What shell do you use? dash? (ls -l /bin/sh)
Can you send us your envvars file?

As I wrote before, it occurs using multistrap.  Multistrap is like
debootstrap but postpones all postinst calls till later.  Therefore
envvars file is the file shipped with the package itself.

/etc/apache2/envvars is included in apache2.2-common. Therefore apache2.2-common may assume that it is present in postinst.

+ env - sh -c '. /etc/apache2/envvars && env'
sh: 1: .: Can't open /etc/apache2/envvars
+ echo 2
+ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Jan  7 18:53 /bin/sh -> bash
+ cat /etc/apache2/envvars
# envvars - default environment variables for apache2ctl

This is rather weird. The shell can't source the file but immediately afterwards the "cat" succeeds. Does multistrap do things in parallel? Or do you do this on NFS or some other strange file system?

Maybe you should run strace -f -tt on the whole multistrap process to see what is happening with respect to /etc/apache2/envvars.

Another possible issue I could imagine (but your log does not really look like it): If removed apache2.2-common in your chroot without purging it, and then deleted /etc/apache2/* by hand. In this case dpkg will not re-create /etc/apache2/envvars during the next installation because it is a conffile.
Reply to: