0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

put correct binary name in web console

This commit is contained in:
Eliot Horowitz 2010-09-10 16:20:50 -04:00
parent 9e4b1298cc
commit 164ef1656a
3 changed files with 11 additions and 2 deletions

View File

@ -77,6 +77,13 @@ namespace mongo {
boost::program_options::variables_map &params ){
{ // setup binary name
cmdLine.binaryName = argv[0];
size_t i = cmdLine.binaryName.rfind( '/' );
if ( i != string::npos )
cmdLine.binaryName = cmdLine.binaryName.substr( i + 1 );
}
/* don't allow guessing - creates ambiguities when some options are
* prefixes of others. allow long disguises and don't allow guessing
* to get away with our vvvvvvv trick. */

View File

@ -24,6 +24,8 @@ namespace mongo {
*/
/* concurrency: OK/READ */
struct CmdLine {
string binaryName; // mongod or mongos
int port; // --port
string bind_ip; // --bind_ip
bool rest; // --rest
@ -56,7 +58,7 @@ namespace mongo {
int pretouch; // --pretouch for replication application (experimental)
bool moveParanoia; // for move chunk paranoia
enum {
DefaultDBPort = 27017,
ConfigServerPort = 27019,

View File

@ -206,7 +206,7 @@ namespace mongo {
string dbname;
{
stringstream z;
z << "mongod " << prettyHostName();
z << cmdLine.binaryName << ' ' << prettyHostName();
dbname = z.str();
}
ss << start(dbname) << h2(dbname);