A spring-boot application treats the escaping of arguments differently at startup as root or as user if it is not using the start-stop-daemon.

The issue was introduced with commit 4c65e5e704cfab3160ea7276304f307c993bddf9 by using printf for arguments if running as root or just passing the arguments if running as user.

How to reproduce:

  1. Create a spring-boot-application with a config file
  2. Add RUN_ARGS with single quote, like RUN_ARGS='--spring.datasource.password=my$password$with$dollars'

  3. Start the application as user will add the RUN_ARGS correct, even for multiline values

  4. Start the application as root will not escape the value.

Solutions to make it predictable - Not using the printf (may be a bad solution? ) - Using printf in all cases as it is currently done for root - Using printf in all cases and reflect single quote escaping defined in the .conf file.

Additional information I was not able to test against the start-stop-daemon. It might by that it is also ignoring the single quote arguments given in the .conf file.

Comment From: Swissbite

Update for peoples who may have the same issue:

Simple workaround: - Add an application.properties anywhere near your deployment path - Add following config to the run args--spring.config.additional-location=./path/to/folder/

Documentation about this config property: 2.3. Application Property Files

Comment From: wilkinsona

To reduce the risk of regression, we should tackle #20335 before fixing this issue.

Comment From: wilkinsona

We’re cleaning out the issue tracker and closing issues that we’ve not seen much demand to fix. Feel free to comment with additional justifications if you feel that this one should not have been closed.

Anyone affected by this issue should use a custom launch script that meets their needs.