Followed the instruction described here in order to customize gradle launchScript and start application as init.d service. Here is my configuration:
tasks.named("bootJar") {
launchScript {
properties 'logFilename': 'app.log'
properties 'logFolder': '/var/local/services/app/logs/'
properties 'pidFolder': '/var/local/services/app/run'
properties 'pidFilename': 'receiver_prod.pid'
properties 'confFolder': '/etc/local/services/app/conf/receiver'
}
}
When starting the service, the configuration file, specified in "confFolder" property, is ignored. That's why the service fails to start, however if the configuration file is placed in the same folder as jar file, then the app successfully starts. How can make sure that the application starts when configuration file is placed in the specified folder?
Configuration file as well as containing it folder has all the necessary read/write permissions and is owned by the same user as the jar file.
Tried to change the path from absolute to relative, still fails to start. Made sure that the other properties work correctly except the confFolder. Also tried to rename the application.properties to app.properties like the name of the jar file. Nothing helped.