Launchpad has imported 18 comments from the remote bug at
http://issues.apache.org/bugzilla/show_bug.cgi?id=43502.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2007-09-28T02:11:47+00:00 Davidf-a wrote:

If httpd is configured to log to a file in a non-existing directory, it refuses
to start up, e.g.:
[Fri Sep 28 03:58:13 2007] [notice] caught SIGTERM, shutting down
(2)No such file or directory: httpd: could not open error log file
/etc/httpd/logs/mailman/error_log.
Unable to open logs

It's useful when restarting Apache to check if any configuration changes will
prevent the restart from being successful (and thus result in down time when the
restart command is issued). However the configuration syntax check doesn't check
if log file directories exist and so doesn't catch this problem

Other non-existing directories (for serving files out of etc) don't prevent the
entire process from starting up and so aren't such critical errors.

It would be great if either
1) the inability to create a log file did not prevent httpd from starting
2) the config test (or another test) checked for this condition (and possible
other config options that would prevent startup)

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/0

------------------------------------------------------------------------
On 2007-09-28T02:32:41+00:00 Davidf-a wrote:

Tried to code a patch for this but couldn't find where ap_run_test_config is
defined :-(

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/1

------------------------------------------------------------------------
On 2008-07-18T03:41:08+00:00 Rahul-g-nair wrote:

Created attachment 22281
use test_config to check if errorlog can be opened

A tiny patch to see if errorlog can be opened during httpd -t
Since test_config does not let me return a value, This will still return
Syntax OK after printing the warning.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/2

------------------------------------------------------------------------
On 2008-07-18T03:42:41+00:00 Rahul-g-nair wrote:

Note: The above patch assumes that mod_log_config is loaded.


Reply at: 
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/3

------------------------------------------------------------------------
On 2009-02-19T06:10:26+00:00 Davidf-a wrote:

Created attachment 23280
Checks error logs and custom logs for the main host

Thanks for the patch rahul! Got me started...

The new patch I'm attaching now also checks files mentioned in CustomLog
or TransferLog directives.

Problems that remain:
 * The attempt is made relative to the current directory, not the eventual 
ServerRoot
 * Virtual Host configurations are not checked

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/4

------------------------------------------------------------------------
On 2009-02-19T06:44:41+00:00 Davidf-a wrote:

Created attachment 23281
Checks error logs and custom logs with relative paths for the main host and 
virtual hosts

Adjusted patch to address the problems above: it now iterates over the
virtual hosts, and relative paths are used too.

It also checks whether the error log is even defined, and adjusts the
language to indicate which config file it is looking at.

Sample output:
[root@kulma httpd]# /etc/init.d/httpd configtest
(2)No such file or directory: Could not open error log file 
/etc/httpd/logs2/error_log for server defined in main config file.
(2)No such file or directory: Could not open log file 
/etc/httpd/logs2/access_log for server defined in main config file.
(2)No such file or directory: Could not open log file 
/etc/httpd/logs2/access_log for server defined in 
/etc/httpd/conf.d/virtual.d/zimbra.conf.
(2)No such file or directory: Could not open error log file 
/etc/httpd/logs2/trac/error_log for server defined in 
/etc/httpd/conf.d/virtual.d/trac.conf.
(2)No such file or directory: Could not open log file 
/etc/httpd/logs2/trac/access_log for server defined in 
/etc/httpd/conf.d/virtual.d/trac.conf.
(2)No such file or directory: Could not open error log file 
/etc/httpd/logs2/error_log for server defined in 
/etc/httpd/conf.d/virtual.d/test.conf.
(2)No such file or directory: Could not open error log file 
/etc/httpd/logs2/error_log for server defined in 
/etc/httpd/conf.d/virtual.d/staging.conf.
(2)No such file or directory: Could not open log file 
/etc/httpd/logs2/access_log for server defined in 
/etc/httpd/conf.d/virtual.d/old.conf.
(2)No such file or directory: Could not open log file 
/etc/httpd/logs2/access_log for server defined in /etc/httpd/conf/httpd.conf.
Syntax OK

The patch is against 2.2.8, and is complete from my side.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/5

------------------------------------------------------------------------
On 2009-02-19T06:53:09+00:00 Davidf-a wrote:

I'm not familiar with Apache procedures, so not sure where to go from
here...

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/6

------------------------------------------------------------------------
On 2009-02-19T08:04:29+00:00 R-nick-q wrote:

(In reply to comment #6)
> I'm not familiar with Apache procedures, so not sure where to go from here...
> 

Posting a patch and marking the bug report PatchAvailable is a good
start.  If you're lucky, someone notices and reviews the patch.  If
nothing happens, you can raise it on the dev list.

First at-a-glance comment on this patch: how does it work with piped
logs?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/7

------------------------------------------------------------------------
On 2009-02-19T08:41:42+00:00 Jorton-9 wrote:

It seems pretty odd to do this.  If you have some process which is
randomly making your log directory unwritable outside of your control
(or knowledge), who is to say that the log directory isn't going to
become unwritable between when the testconfig hook runs, and startup
completes?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/8

------------------------------------------------------------------------
On 2009-02-19T10:00:37+00:00 Davidf-a wrote:

(In reply to comment #8)
> It seems pretty odd to do this.  If you have some process which is randomly
> making your log directory unwritable outside of your control (or knowledge),
> who is to say that the log directory isn't going to become unwritable between
> when the testconfig hook runs, and startup completes?
> 

The original use case for this was not someone making the log directory
unwriteable, but someone (myself!) forgetting to add the directory
referred to in the ErrorLog directive. I would then run configtest and
since it said everything looked OK, thought I was good to go - but
restarting the server would actually stop it dead.

At least printing out a warning gives you a flag that that needs to be
fixed. It needn't actually try writing to the files - just checking that
their directories exist would be OK for me...

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/9

------------------------------------------------------------------------
On 2009-02-19T12:43:09+00:00 Davidf-a wrote:

(In reply to comment #7)
> (In reply to comment #6)
> > I'm not familiar with Apache procedures, so not sure where to go from 
> > here...
> > 
> 
> Posting a patch and marking the bug report PatchAvailable is a good start.  If
> you're lucky, someone notices and reviews the patch.  If nothing happens, you
> can raise it on the dev list.
Great, thanks
> First at-a-glance comment on this patch: how does it work with piped logs?
It didn't, thanks :-)
Will attach a new version...

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/10

------------------------------------------------------------------------
On 2009-02-19T12:48:07+00:00 Davidf-a wrote:

Created attachment 23282
Checks error logs and custom logs with relative paths for the main host and 
virtual hosts, ignoring pipes

Attached new patch ignoring piped logs

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/11

------------------------------------------------------------------------
On 2009-10-26T08:55:34+00:00 Martin-smith-1 wrote:

Apache also doesn't bother checking if log directories exist when you
reload it with /etc/init.d/httpd reload and just fails silently, meaning
your sites go down because you added a new vhost and forgot to make the
log directory.

It also would be nice if the reload init script printed something to
stderr if something went wrong.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/12

------------------------------------------------------------------------
On 2014-04-16T07:53:42+00:00 Julius-4 wrote:

Seriously, we're 5 years onwards and this still has not made it into the
stable release?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/15

------------------------------------------------------------------------
On 2014-06-13T11:12:00+00:00 Aeoris wrote:

Almost 7 years and counting. This is still an issue in most recent
versions. What the heck, Apache?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/16

------------------------------------------------------------------------
On 2016-01-08T09:53:25+00:00 Anthony Geoghegan wrote:

Over the past few years, I've been bitten by this issue on a number of
occasions where the *Error Log* for a virtual host configuration had its
directory moved / renamed but the `configtest` still reports that
everything is OK.

I created an account to report this as a bug / feature request only to
discover that a patch for this issue was already submitted over 7 years
ago. As a user, I'd love to see this patch (or a revised version of it)
added to the production code.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/17

------------------------------------------------------------------------
On 2018-02-25T20:31:29+00:00 Rainer Jung wrote:

Undo spam change

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/22

------------------------------------------------------------------------
On 2019-12-20T23:18:59+00:00 Vladimir Kondratyev wrote:

Just another victim of this bug. I have a Docker container with Apache.
All was OK until I mounted container's /var/log of to host's ~/log.

According to Docker documentation content of non-empty directory is
obscured by bind mount, so I've got empty /var/log after container
start.

The problem became even worse, because due to lack of /var/log/apache2,
the httpd process was not able to log error about missing log. As the
result the container started, but Apache did not.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/936216/comments/23


** Changed in: apache2
       Status: Unknown => Confirmed

** Changed in: apache2
   Importance: Unknown => Wishlist

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/936216

Title:
  Apache doesn't start if /var/log/apache2 is missing

To manage notifications about this bug go to:
https://bugs.launchpad.net/apache2/+bug/936216/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to