diff --git a/src/main/resources/com/typesafe/sbt/packager/archetypes/java_server/systemloader/systemd/start-template b/src/main/resources/com/typesafe/sbt/packager/archetypes/java_server/systemloader/systemd/start-template index c9625e19d..3add38652 100644 --- a/src/main/resources/com/typesafe/sbt/packager/archetypes/java_server/systemloader/systemd/start-template +++ b/src/main/resources/com/typesafe/sbt/packager/archetypes/java_server/systemloader/systemd/start-template @@ -9,6 +9,10 @@ ExecStart=${{chdir}}/bin/${{exec}} Restart=always RestartSec=${{retryTimeout}} User=${{daemon_user}} +ExecStartPre=/bin/mkdir -p /run/${{app_name}} +ExecStartPre=/bin/chown ${{daemon_user}}:${{daemon_group}} /run/${{app_name}} +ExecStartPre=/bin/chmod 755 /run/${{app_name}} +PermissionsStartOnly=true [Install] WantedBy=multi-user.target