https://issues.apache.org/bugzilla/show_bug.cgi?id=48059

           Summary: org.apache.catalina.startup.Bootstrap's main method
                    handles 'startd' or 'stopd' wrongly
           Product: Tomcat 7
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: qingyang...@qunar.com


String command = "start";
if (args.length > 0) {
    command = args[args.length - 1];
}

if (command.equals("startd")) {
    args[0] = "start";
    daemon.load(args);
    daemon.start();
} else if (command.equals("stopd")) {
    args[0] = "stop";
    daemon.stop();
}

should be: 

String command = "start";
if (args.length > 0) {
    command = args[args.length - 1];
}
if (command.equals("startd")) {
    args[args.length - 1] = "start";
    daemon.load(args);
    daemon.start();
} else if (command.equals("stopd")) {
    args[args.length - 1] = "stop";
    daemon.stop();
} 
... ...

Consider what whould happen if Bootstrap is invoked as :

org.apache.catalina.startup.Bootstrap -nonaming startd


Please refer to the following usage method of 
org.apache.catalina.startup.Catalina:
/**
     * Print usage information for this application.
     */
    protected void usage() {

        System.out.println
            ("usage: java org.apache.catalina.startup.Catalina"
             + " [ -config {pathname} ]"
             + " [ -nonaming ] { start | stop }");

    }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to