Bug 55104

Summary: Allow passing arguments with spaces to Commons Daemon
Product: Tomcat 7 Reporter: marko asplund <marko.asplund>
Component: IntegrationAssignee: Tomcat Developers Mailing List <dev>
Status: NEW ---    
Severity: enhancement CC: marko.asplund
Priority: P2    
Version: 7.0.41   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: allow passing arguments with spaces

Description marko asplund 2013-06-16 18:13:45 UTC
With the current version of the Commons Daemon wrapper script (daemon.sh) it's not possible to pass arguments with spaces to jsvc.

For example jsvc fails to start with the following command:

JSVC_OPTS="-XX:OnOutOfMemoryError='/bin/ls foo bar'" daemon.sh start

The attached patch makes it possible to pass arguments with spaces to Commons Daemon like this:

daemon.sh start -XX:OnOutOfMemoryError='/bin/ls foo bar'

The patch also allows daemon.sh invoker override hardcoded arguments (i.e. "-wait"). Overriding the current wait default value is often required because Tomcat startup may take a long time due to entropy read operation blocking by default on Linux.
Comment 1 marko asplund 2013-06-16 18:15:09 UTC
Created attachment 30446 [details]
allow passing arguments with spaces
Comment 2 Michael Osipov 2019-08-12 14:16:26 UTC
..and it won't because Bourne shell does not support this. Same issue persists for the Maven start script. One would need to switch to Bash.