-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue in template #606
Comments
Take a look at #602. This is happens because Play itself tries to create pid file in CWD. When you aren't using play app you don't need to pass |
Is it not preferable that the plugin accept a value for JAVA_OPTS configured in the build and use the same instead of the template for /etc/default using the commented line. This will ensure that users of the plugin can specify a value or choose not to use one. |
Apologies, as we had not looked through all of the documentation and now we know how to supply an override for files (such as /etc/default/). At the moment, we are still trying to figure out what the issue is when a JAVA_OPTS is not supplied. Any pointers? You may go ahead and close the issue. |
As @kardapoltsev pointed out, play creates the PID file itself. If you use see #541 for the code details |
We are running play application and using 'sbt-native-packager' generated the rpm installer.
When we install rpm on centos-7 it started the application.
we can verify it by running
/etc/init.d/<app_name> status
command, But we noticed the application was not running, And when we checked the logs at/var/log/<app_name>/daemon.log
is saysException in thread "main" java.io.FileNotFoundException: /usr/share/<app_name>/RUNNING_PID (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at java.io.FileOutputStream.(FileOutputStream.java:162)
So, the problem was, it tried to find the RUNNING_PID at the application home, but in the startup script
/etc/init.d/<app_name>
the pidfile value was/var/run/<app_name>/running.pid
.After some investigation, we are able to run the application, but that need one change in /etc/default/<app_name> script. The change we made was uncommenting this line
JAVA_OPTS="-Dpidfile.path=/var/run/<app_name>/play.pid $JAVA_OPTS"
We went further and fork the sbt-native-packager repo and made the fix in the template
etc-default-template
. and verified it by using following steps:Change the version to end with -SNAPSHOT
run sbt publishLocal
Change the plugin version with *-SNAPSHOT version in our application
And now when we installed the application rpm on fresh centos-7, application runs successfully.
Can we send the pull request for the issue? we haven't tested it on other platform.
The text was updated successfully, but these errors were encountered: