You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently trying to deploy a play 2.4 application using the native-packager's debian and systemd support
My stripped down build.sbt looks as follows
val generalSettings = Seq(
...
serverLoading in Debian := ServerLoader.Systemd,
daemonUser in Linux := "deploy",
daemonGroup in Linux := "deploy"
)
lazy val shop = project.in(file("modules/shop"))
.settings(generalSettings: _*)
.enablePlugins(PlayScala, JavaServerAppPackaging, JDebPackaging)```
My problem is now, that the target server needs elevated rights for installing the generated .deb package via dpkg. Thus, the folder /user/share/shop is owned by root after installation, but the systemd service is started by deploy. As a result play won't start with java.io.FileNotFoundException: /usr/share/shop/RUNNING_PID (Permission denied)
Is there a way to tell the packager that the systemd service should chown the /usr/share/<project> folder for the user specified by the daemonUser SettingKey? Or do i need to create a custom template for doing this?
If the latter, where would I put this template? The documentation at [http://www.scala-sbt.org/sbt-native-packager/archetypes/java_server/customize.html#override-start-script](Override Start Script) says it should be put at /src/templates, but there is no such folder in a play application. Can the template location be customized?
The text was updated successfully, but these errors were encountered:
Thanks for your detailed bug report. You are hitting a common issue with configuring play for production. Play, by default, has a custom pid handling, which you can disable. There is also a small section on native packager and in our documentation. The best way is to disable plays pid handling.
Important take away: /usr/share/<yourapp> is and should always be owned by root. If you need write access to the file system. The JavaServerAppPackaging archetype provides to folders
Hey.
I'm currently trying to deploy a play 2.4 application using the native-packager's debian and systemd support
My stripped down build.sbt looks as follows
and the generated systemd unit looks like this:
My problem is now, that the target server needs elevated rights for installing the generated .deb package via
dpkg
. Thus, the folder/user/share/shop
is owned by root after installation, but the systemd service is started by deploy. As a result play won't start withjava.io.FileNotFoundException: /usr/share/shop/RUNNING_PID (Permission denied)
Is there a way to tell the packager that the systemd service should chown the
/usr/share/<project>
folder for the user specified by thedaemonUser
SettingKey? Or do i need to create a custom template for doing this?If the latter, where would I put this template? The documentation at [http://www.scala-sbt.org/sbt-native-packager/archetypes/java_server/customize.html#override-start-script](Override Start Script) says it should be put at /src/templates, but there is no such folder in a play application. Can the template location be customized?
The text was updated successfully, but these errors were encountered: