Bug #47595 Don't print log lines to STDOUT for ndb_mgmd
Submitted: 24 Sep 12:09
Reporter: Geert Vanderkelen
Status: Verified
Category:Server: Cluster Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:Any
Assigned to: Magnus Blaudd Target Version:
Tags: mysql-5.1.35-telco-7.0.7
Triage: Triaged: D4 (Minor) / R2 (Low) / E6 (Needs Assessment)

[24 Sep 12:09] Geert Vanderkelen
Description:
When you start ndb_mgmd you have 2 lines which are actually lines belonging in the
cluster log. They should instead be showing as normal messages, or show up with the
--verbose option.

How to repeat:
shell> ndb_mgmd 2>/dev/null
2009-09-24 12:03:52 [MgmSrvr] INFO     -- NDB Cluster Management Server. mysql-5.1.35
ndb-7.0.7
2009-09-24 12:03:52 [MgmSrvr] INFO     -- Loaded config from
'/data2/users/geert/cluster/master/ndb_1_config.bin.1'

Suggested fix:
The 'Loaded config from..' should actually be in the cluster logs, it is not currently.
Both lines can show up, but I would rather show them asd normal messages:

shell> ndb_mgmd
NDB Cluster Management Server. mysql-5.1.35 ndb-7.0.7
Loaded config from '/data2/users/geert/cluster/master/ndb_1_config.bin.1'

Even better, show them with the --verbose option only.
[28 Sep 15:52] Magnus Blaudd
I think we need to decide what(if any) the ndb_mgmd should print to console when it has
been started to become a daemon, but not yet has become one.
[28 Sep 16:07] Geert Vanderkelen
Since ndb_mgmd is a deamon and started usually inside (init.d) scripts, one should not
rely on giving any 'useful' information on STDOUT/STDERR, but give it in logs.
Unless --verbose is given.

I'm usually starting such processes with 2>/dev/null 1>&2 </dev/null to make sure STD*
are 'detached'.
[29 Sep 15:07] Magnus Blaudd
Ok, so you are saying that "nothing" is fine. I tend to agree, it just looks like the
original intention(by someone) was to just print "MySQL Cluster Management server X.X.X"
and then go into background.

I guess that would be ok? Or should we not write anything after option parsing?
[30 Sep 11:04] Geert Vanderkelen
I guess printing out the version is owkay. Most folks will pipe them into /dev/null anyway
:)