You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "David Newcomb (JIRA)" <ji...@apache.org> on 2010/03/18 18:04:27 UTC

[jira] Created: (DAEMON-148) Incorrect case on parameter causes silent failure

Incorrect case on parameter causes silent failure
-------------------------------------------------

                 Key: DAEMON-148
                 URL: https://issues.apache.org/jira/browse/DAEMON-148
             Project: Commons Daemon
          Issue Type: Bug
          Components: Procrun
            Reporter: David Newcomb
             Fix For: 1.0.3


Unknown parameters passed to procrun halt command line option processing, silently ignoring the other options, then reports as successful.

For example:
C:\Data\tomcat\bin\tomcat6.exe //US//Tomcat ^
  --LogPath C:\Data\tomcat\logs ^
  --LogPrefix commons-daemon ^
  --LogLevel debug ^
  --Description "Apache Tomcat - Company app" ^
  --StartClass org.apache.catalina.startup.Bootstrap ^
  --StopClass org.apache.catalina.startup.Bootstrap ^
  --StartParams start ^
  --StopParams stop ^
  --DependsOn MySQL ^
  --StartMode jvm ^
  --StopMode jvm ^
  --JvmOptions -Dcatalina.base=C:\Data\tomcat ^
  --JvmOptions -Dcatalina.home=C:\Data\tomcat ^
  --JvmOptions -Djava.endorsed.dirs=C:\Data\tomcat\endorsed ^
  --classpath C:\Data\tomcat\bin\bootstrap.jar ^
  --JvmOptions -Djava.io.tmpdir=C:\Data\tomcat\temp ^
  --JvmOptions -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager ^
  --JvmOptions -Djava.util.logging.config.file=C:\Data\tomcat\conf\logging.properties ^
  --JvmOptions -Dcom.sun.management.jmxremote ^
  --JvmOptions -Dcom.sun.management.jmxremote.port=8181 ^
  --JvmOptions -Dcom.sun.management.jmxremote.authenticate=false ^
  --JvmOptions -Dcom.sun.management.jmxremote.ssl=false ^
  --JvmOptions -XX:+HeapDumpOnOutOfMemoryError ^
  --JvmMs 256 ^
  --JvmMx 512 ^
  --Jvm c:\data\java\bin\server\jvm.dll ^
  --JavaHome c:\data\java ^
  --Startup auto

The   "--classpath C:\Data\tomcat\bin\bootstrap.jar ^" line introduces an invalid command line parameter. It should be --Classpath instead of --classpath.

The log reads:
[2010-03-18 16:56:00] [debug] ( prunsrv.c:1412) Commons Daemon procrun log initialized
[2010-03-18 16:56:00] [info] Commons Daemon procrun (1.0.3.0) started
[2010-03-18 16:56:00] [info] Updating service...
[2010-03-18 16:56:00] [error] ( service.c:126 ) The specified service does not exist as an installed service.
[2010-03-18 16:56:00] [debug] ( prunsrv.c:507 ) Installing service...
[2010-03-18 16:56:00] [info] Service Tomcat name 
[2010-03-18 16:56:00] [debug] ( prunsrv.c:559 ) Setting service description Apache Tomcat - Quantel Dino
[2010-03-18 16:56:00] [info] Service 'Tomcat' installed
[2010-03-18 16:56:00] [info] Commons Daemon procrun finished

Showing that the installation was successful. However if you load up tomcat6w then you can see in the Java tab that the last option to be processed was "--JvmOptions -Djava.endorsed.dirs...." every other entry after that is ignored.

This creates an ordering issue with the command line options. If the LogPath is at the end of the parameter list then no output file will be created.
As a result running the service always fails.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (DAEMON-148) Incorrect case on parameter causes silent failure

Posted by "David Newcomb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DAEMON-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Newcomb reopened DAEMON-148:
----------------------------------


Then, by your own admission it is a bug. It ignores the valid commands after the invalid one.
So changing the order of the parameters changes the initialisation of the program.
If you were to remove/rename a parameter it would break everyone else's start up depending on the order they specified their parameter list.

I understand the benefits of ignoring unknown commands but the bug is in the fact that it doesn't process the rest of the valid parameters.


> Incorrect case on parameter causes silent failure
> -------------------------------------------------
>
>                 Key: DAEMON-148
>                 URL: https://issues.apache.org/jira/browse/DAEMON-148
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>            Reporter: David Newcomb
>             Fix For: 1.0.3
>
>
> Unknown parameters passed to procrun halt command line option processing, silently ignoring the other options, then reports as successful.
> For example:
> C:\Data\tomcat\bin\tomcat6.exe //US//Tomcat ^
>   --LogPath C:\Data\tomcat\logs ^
>   --LogPrefix commons-daemon ^
>   --LogLevel debug ^
>   --Description "Apache Tomcat - Company app" ^
>   --StartClass org.apache.catalina.startup.Bootstrap ^
>   --StopClass org.apache.catalina.startup.Bootstrap ^
>   --StartParams start ^
>   --StopParams stop ^
>   --DependsOn MySQL ^
>   --StartMode jvm ^
>   --StopMode jvm ^
>   --JvmOptions -Dcatalina.base=C:\Data\tomcat ^
>   --JvmOptions -Dcatalina.home=C:\Data\tomcat ^
>   --JvmOptions -Djava.endorsed.dirs=C:\Data\tomcat\endorsed ^
>   --classpath C:\Data\tomcat\bin\bootstrap.jar ^
>   --JvmOptions -Djava.io.tmpdir=C:\Data\tomcat\temp ^
>   --JvmOptions -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager ^
>   --JvmOptions -Djava.util.logging.config.file=C:\Data\tomcat\conf\logging.properties ^
>   --JvmOptions -Dcom.sun.management.jmxremote ^
>   --JvmOptions -Dcom.sun.management.jmxremote.port=8181 ^
>   --JvmOptions -Dcom.sun.management.jmxremote.authenticate=false ^
>   --JvmOptions -Dcom.sun.management.jmxremote.ssl=false ^
>   --JvmOptions -XX:+HeapDumpOnOutOfMemoryError ^
>   --JvmMs 256 ^
>   --JvmMx 512 ^
>   --Jvm c:\data\java\bin\server\jvm.dll ^
>   --JavaHome c:\data\java ^
>   --Startup auto
> The   "--classpath C:\Data\tomcat\bin\bootstrap.jar ^" line introduces an invalid command line parameter. It should be --Classpath instead of --classpath.
> The log reads:
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:1412) Commons Daemon procrun log initialized
> [2010-03-18 16:56:00] [info] Commons Daemon procrun (1.0.3.0) started
> [2010-03-18 16:56:00] [info] Updating service...
> [2010-03-18 16:56:00] [error] ( service.c:126 ) The specified service does not exist as an installed service.
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:507 ) Installing service...
> [2010-03-18 16:56:00] [info] Service Tomcat name 
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:559 ) Setting service description Apache Tomcat - Quantel Dino
> [2010-03-18 16:56:00] [info] Service 'Tomcat' installed
> [2010-03-18 16:56:00] [info] Commons Daemon procrun finished
> Showing that the installation was successful. However if you load up tomcat6w then you can see in the Java tab that the last option to be processed was "--JvmOptions -Djava.endorsed.dirs...." every other entry after that is ignored.
> This creates an ordering issue with the command line options. If the LogPath is at the end of the parameter list then no output file will be created.
> As a result running the service always fails.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DAEMON-148) Incorrect case on parameter causes silent failure

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DAEMON-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated DAEMON-148:
------------------------

    Fix Version/s: 1.0.3
                       (was: 1.0.2)

> Incorrect case on parameter causes silent failure
> -------------------------------------------------
>
>                 Key: DAEMON-148
>                 URL: https://issues.apache.org/jira/browse/DAEMON-148
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>            Reporter: David Newcomb
>             Fix For: 1.0.3
>
>
> Unknown parameters passed to procrun halt command line option processing, silently ignoring the other options, then reports as successful.
> For example:
> C:\Data\tomcat\bin\tomcat6.exe //US//Tomcat ^
>   --LogPath C:\Data\tomcat\logs ^
>   --LogPrefix commons-daemon ^
>   --LogLevel debug ^
>   --Description "Apache Tomcat - Company app" ^
>   --StartClass org.apache.catalina.startup.Bootstrap ^
>   --StopClass org.apache.catalina.startup.Bootstrap ^
>   --StartParams start ^
>   --StopParams stop ^
>   --DependsOn MySQL ^
>   --StartMode jvm ^
>   --StopMode jvm ^
>   --JvmOptions -Dcatalina.base=C:\Data\tomcat ^
>   --JvmOptions -Dcatalina.home=C:\Data\tomcat ^
>   --JvmOptions -Djava.endorsed.dirs=C:\Data\tomcat\endorsed ^
>   --classpath C:\Data\tomcat\bin\bootstrap.jar ^
>   --JvmOptions -Djava.io.tmpdir=C:\Data\tomcat\temp ^
>   --JvmOptions -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager ^
>   --JvmOptions -Djava.util.logging.config.file=C:\Data\tomcat\conf\logging.properties ^
>   --JvmOptions -Dcom.sun.management.jmxremote ^
>   --JvmOptions -Dcom.sun.management.jmxremote.port=8181 ^
>   --JvmOptions -Dcom.sun.management.jmxremote.authenticate=false ^
>   --JvmOptions -Dcom.sun.management.jmxremote.ssl=false ^
>   --JvmOptions -XX:+HeapDumpOnOutOfMemoryError ^
>   --JvmMs 256 ^
>   --JvmMx 512 ^
>   --Jvm c:\data\java\bin\server\jvm.dll ^
>   --JavaHome c:\data\java ^
>   --Startup auto
> The   "--classpath C:\Data\tomcat\bin\bootstrap.jar ^" line introduces an invalid command line parameter. It should be --Classpath instead of --classpath.
> The log reads:
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:1412) Commons Daemon procrun log initialized
> [2010-03-18 16:56:00] [info] Commons Daemon procrun (1.0.3.0) started
> [2010-03-18 16:56:00] [info] Updating service...
> [2010-03-18 16:56:00] [error] ( service.c:126 ) The specified service does not exist as an installed service.
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:507 ) Installing service...
> [2010-03-18 16:56:00] [info] Service Tomcat name 
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:559 ) Setting service description Apache Tomcat - Quantel Dino
> [2010-03-18 16:56:00] [info] Service 'Tomcat' installed
> [2010-03-18 16:56:00] [info] Commons Daemon procrun finished
> Showing that the installation was successful. However if you load up tomcat6w then you can see in the Java tab that the last option to be processed was "--JvmOptions -Djava.endorsed.dirs...." every other entry after that is ignored.
> This creates an ordering issue with the command line options. If the LogPath is at the end of the parameter list then no output file will be created.
> As a result running the service always fails.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DAEMON-148) Incorrect case on parameter causes silent failure

Posted by "Mladen Turk (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DAEMON-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mladen Turk resolved DAEMON-148.
--------------------------------

    Fix Version/s: 1.0.2
                       (was: 1.0.3)
       Resolution: Fixed

OK. Fixed the code so that error is reported on unknown option.
This will also cause the procrun to fail the operation and exit with error code.

> Incorrect case on parameter causes silent failure
> -------------------------------------------------
>
>                 Key: DAEMON-148
>                 URL: https://issues.apache.org/jira/browse/DAEMON-148
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>            Reporter: David Newcomb
>             Fix For: 1.0.2
>
>
> Unknown parameters passed to procrun halt command line option processing, silently ignoring the other options, then reports as successful.
> For example:
> C:\Data\tomcat\bin\tomcat6.exe //US//Tomcat ^
>   --LogPath C:\Data\tomcat\logs ^
>   --LogPrefix commons-daemon ^
>   --LogLevel debug ^
>   --Description "Apache Tomcat - Company app" ^
>   --StartClass org.apache.catalina.startup.Bootstrap ^
>   --StopClass org.apache.catalina.startup.Bootstrap ^
>   --StartParams start ^
>   --StopParams stop ^
>   --DependsOn MySQL ^
>   --StartMode jvm ^
>   --StopMode jvm ^
>   --JvmOptions -Dcatalina.base=C:\Data\tomcat ^
>   --JvmOptions -Dcatalina.home=C:\Data\tomcat ^
>   --JvmOptions -Djava.endorsed.dirs=C:\Data\tomcat\endorsed ^
>   --classpath C:\Data\tomcat\bin\bootstrap.jar ^
>   --JvmOptions -Djava.io.tmpdir=C:\Data\tomcat\temp ^
>   --JvmOptions -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager ^
>   --JvmOptions -Djava.util.logging.config.file=C:\Data\tomcat\conf\logging.properties ^
>   --JvmOptions -Dcom.sun.management.jmxremote ^
>   --JvmOptions -Dcom.sun.management.jmxremote.port=8181 ^
>   --JvmOptions -Dcom.sun.management.jmxremote.authenticate=false ^
>   --JvmOptions -Dcom.sun.management.jmxremote.ssl=false ^
>   --JvmOptions -XX:+HeapDumpOnOutOfMemoryError ^
>   --JvmMs 256 ^
>   --JvmMx 512 ^
>   --Jvm c:\data\java\bin\server\jvm.dll ^
>   --JavaHome c:\data\java ^
>   --Startup auto
> The   "--classpath C:\Data\tomcat\bin\bootstrap.jar ^" line introduces an invalid command line parameter. It should be --Classpath instead of --classpath.
> The log reads:
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:1412) Commons Daemon procrun log initialized
> [2010-03-18 16:56:00] [info] Commons Daemon procrun (1.0.3.0) started
> [2010-03-18 16:56:00] [info] Updating service...
> [2010-03-18 16:56:00] [error] ( service.c:126 ) The specified service does not exist as an installed service.
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:507 ) Installing service...
> [2010-03-18 16:56:00] [info] Service Tomcat name 
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:559 ) Setting service description Apache Tomcat - Quantel Dino
> [2010-03-18 16:56:00] [info] Service 'Tomcat' installed
> [2010-03-18 16:56:00] [info] Commons Daemon procrun finished
> Showing that the installation was successful. However if you load up tomcat6w then you can see in the Java tab that the last option to be processed was "--JvmOptions -Djava.endorsed.dirs...." every other entry after that is ignored.
> This creates an ordering issue with the command line options. If the LogPath is at the end of the parameter list then no output file will be created.
> As a result running the service always fails.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DAEMON-148) Incorrect case on parameter causes silent failure

Posted by "Mladen Turk (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DAEMON-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mladen Turk closed DAEMON-148.
------------------------------

    Resolution: Won't Fix

This is not a bug but rather a feature :)

Seriously, silent discarding of unknown command line options was made by purpose
so that we can add config options without breaking binary compatibility.
We cannot even check for --Classpath  missing, cause one can later use the //US//Foo --Classpath=x.jar at any time

Make sure you don't make typos :)


> Incorrect case on parameter causes silent failure
> -------------------------------------------------
>
>                 Key: DAEMON-148
>                 URL: https://issues.apache.org/jira/browse/DAEMON-148
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>            Reporter: David Newcomb
>             Fix For: 1.0.3
>
>
> Unknown parameters passed to procrun halt command line option processing, silently ignoring the other options, then reports as successful.
> For example:
> C:\Data\tomcat\bin\tomcat6.exe //US//Tomcat ^
>   --LogPath C:\Data\tomcat\logs ^
>   --LogPrefix commons-daemon ^
>   --LogLevel debug ^
>   --Description "Apache Tomcat - Company app" ^
>   --StartClass org.apache.catalina.startup.Bootstrap ^
>   --StopClass org.apache.catalina.startup.Bootstrap ^
>   --StartParams start ^
>   --StopParams stop ^
>   --DependsOn MySQL ^
>   --StartMode jvm ^
>   --StopMode jvm ^
>   --JvmOptions -Dcatalina.base=C:\Data\tomcat ^
>   --JvmOptions -Dcatalina.home=C:\Data\tomcat ^
>   --JvmOptions -Djava.endorsed.dirs=C:\Data\tomcat\endorsed ^
>   --classpath C:\Data\tomcat\bin\bootstrap.jar ^
>   --JvmOptions -Djava.io.tmpdir=C:\Data\tomcat\temp ^
>   --JvmOptions -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager ^
>   --JvmOptions -Djava.util.logging.config.file=C:\Data\tomcat\conf\logging.properties ^
>   --JvmOptions -Dcom.sun.management.jmxremote ^
>   --JvmOptions -Dcom.sun.management.jmxremote.port=8181 ^
>   --JvmOptions -Dcom.sun.management.jmxremote.authenticate=false ^
>   --JvmOptions -Dcom.sun.management.jmxremote.ssl=false ^
>   --JvmOptions -XX:+HeapDumpOnOutOfMemoryError ^
>   --JvmMs 256 ^
>   --JvmMx 512 ^
>   --Jvm c:\data\java\bin\server\jvm.dll ^
>   --JavaHome c:\data\java ^
>   --Startup auto
> The   "--classpath C:\Data\tomcat\bin\bootstrap.jar ^" line introduces an invalid command line parameter. It should be --Classpath instead of --classpath.
> The log reads:
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:1412) Commons Daemon procrun log initialized
> [2010-03-18 16:56:00] [info] Commons Daemon procrun (1.0.3.0) started
> [2010-03-18 16:56:00] [info] Updating service...
> [2010-03-18 16:56:00] [error] ( service.c:126 ) The specified service does not exist as an installed service.
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:507 ) Installing service...
> [2010-03-18 16:56:00] [info] Service Tomcat name 
> [2010-03-18 16:56:00] [debug] ( prunsrv.c:559 ) Setting service description Apache Tomcat - Quantel Dino
> [2010-03-18 16:56:00] [info] Service 'Tomcat' installed
> [2010-03-18 16:56:00] [info] Commons Daemon procrun finished
> Showing that the installation was successful. However if you load up tomcat6w then you can see in the Java tab that the last option to be processed was "--JvmOptions -Djava.endorsed.dirs...." every other entry after that is ignored.
> This creates an ordering issue with the command line options. If the LogPath is at the end of the parameter list then no output file will be created.
> As a result running the service always fails.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.