Bug #8271 pipe'd logs
Submitted: 2 Feb 2005 16:28 Modified: 23 May 2005 2:30
Reporter: Stian Skjelstad Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.22 OS:Linux (linux)
Assigned to: Jim Winstead CPU Architecture:Any

[2 Feb 2005 16:28] Stian Skjelstad
Description:
If you have fifoes / named piped or unix sockets, and want to use them as logging targets (let's say that an applications wants to embed around mysqld, since mysql-embedded isn't powerfull enough), it failes since it wants to seek to end of the file.

mknod /tmp/mylog.log f

let application attach to the fifo, and it fires off mysqld like this

mysqld --log /tmp/mylog.log

mysqld tries to seek the mylog.log which of-course failes, and gives up the logging

The /tmp/mylog.log is opened O_APPEND, so there is no need to seek to the end of the file.

How to repeat:
mknod /tmp/mylog.log f
mysqld --log /tmp/mylog.log

Suggested fix:
Skip fseek() to EOF when file is opened O_APPEND, it is overkill
[5 Feb 2005 9:34] Aleksey Kishkin
I guess you meant 
mknod /tmp/mylog.log p
[5 Feb 2005 10:32] Stian Skjelstad
That is true. A minor typo when writing the bug-report, but the problem still persist.

Sorry
[7 Feb 2005 11:32] Aleksey Kishkin
When I tried to use fifo as log file, I got "file not found" error and mysqld failed to start.
[17 Feb 2005 0:56] Jim Winstead
This patch requires changes in the I/O caching subsystem that make it only likely to be accepted in the 5.0 series.
[18 Feb 2005 21:50] Guilhem Bichot
Documentation team: please make sure that the changelog entry mentions that this fix applies neither to the binary log nor to the relay log; those logs cannot be pipes or FIFOs, even after this patch is pushed. I'm asking for an explicit mention like "Logs (at the exception of the binary log and relay log) etc".
[7 Mar 2005 21:55] Jim Winstead
Pushed, will appear in 5.0.3.
[7 Mar 2005 23:49] Paul Dubois
Noted in 5.0.3 changelog, with explicit note
that the change doesn't apply to binary/relay
logs.
[8 Mar 2005 18:40] Jim Winstead
There were problems with the patch that was pushed. It has been reverted.
[10 Mar 2005 1:15] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/22871
[6 May 2005 16:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24630
[13 May 2005 14:16] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24866
[20 May 2005 0:09] Jim Winstead
Fixed in 5.0.6.
[23 May 2005 2:30] Paul Dubois
Noted in 5.0.6 changelog.