Bug #38607 Write-protected log file causes init script to fail
Submitted: 6 Aug 2008 16:37 Modified: 20 Jan 2016 14:53
Reporter: Kay Roepke Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Enterprise Monitor: Agent Severity:S3 (Non-critical)
Version:1.3, 2.0 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: Agent, startup script

[6 Aug 2008 16:37] Kay Roepke
Description:
If the agent's log file is write-protected the init.d script fails to notice the early exit of the agent.
It will wait until the startup timeout elapsed (default: 120 seconds) rather than exit immediately.
There is not indication of what the error was.

How to repeat:
Remove the write permission from the log file and start the agent using the supplied init.d script.

Suggested fix:
The startup script should redirect STDERR and check the return code from the agent process in addition to waiting for the PID file to appear.
[6 Aug 2008 16:39] Kay Roepke
Possibly the same underlying issue as Bug#37108
[11 Aug 2008 11:56] Kay Roepke
Fixed in revision 970.
The init script now checks the return value of the executable (should be 0 if it daemonize worked correctly) and displays STDERR of the executable.
Otherwise all messages go to the logfile, if writable.
[11 Aug 2008 11:58] Kay Roepke
Not fixed in 1.3.x yet
[11 Sep 2008 21:42] Diego Medina
tested 2.0.0.7049 and it has not been fixed

==================

I chmod 000 the log file:

[$] ll  /Applications/mysql/enterprise/agent/mysql-monitor-agent.log 
----------  1 wizard  admin  785937 Sep 11 17:04 /Applications/mysql/enterprise/agent/mysql-monitor-agent.log

And then I run

/Applications/mysql/enterprise/agent/etc/init.d/mysql-monitor-agent start

and the script just sits there, showing the dots until the timeout (120 seconds)
[10 Oct 2008 15:58] Diego Medina
This would normally happen at least on cases where the agent is installed under one user (root as as example) and then you try to run it as another user.

The default permissions on the file are:

-rw-r----- 1 root root 29553825 2008-10-10 08:24 mysql-monitor-agent.log

when installing it on linux as root.

It would be nice it you get an error right away, instead of having to wait for 2 minutes.
[20 Jan 2016 14:53] Mark Leith
This 2.x agent is no longer supported. Closing.