MojoJojo MojoJojo - 11 months ago 42
Scala Question

SBT Native Packager SystemVLoader not generating SystemLoader scripts

I have a scala SBT project where I'm using the native packager plugin. I'm bundling as a

and would like to generate scripts for automatically registering the application for startup and shutdown with
scripts (Amazon Linux).
In my plugins.sbt:

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.2.0-M5")

In build.sbt

lazy val server =
DefProject("some/server", "server")
.settings(ServerSettings.allSettings: _*)
.settings(CloudFormation.defaultSettings: _*)
.settings(serverLoading in Universal := Option(ServerLoader.SystemV))
.settings(stackRegion := "US_WEST_2")
.settings(codedeployAWSCredentialsProvider := Option(new ProfileCredentialsProvider("devcredentialsprovider")))
.enablePlugins(JavaServerAppPackaging, SystemVPlugin)

when I run
sbt stage
I can see a
folder containing a
folder with a sh and a cmd file to start the application. However, there is not code to register/start the application as a system service. Is there any additional configuration required to have the plugin generate scripts for registering the application? What am I missing?

I have a created a basic project to demonstrate the issue:

Answer Source

Your configuration is correct. Your sbt command isn't :)

with packageBin ( which IIRC triggers universal:packageBin ) generates only a universal zip file. A systemloader is a operating system specific part. That's why it's not included in a universal zip.

Generate a debian or rpm file with


The generated deb or rpm package will have the systemloader files included, because they are in the place a rpm/debian based system would expect them.

Related issue: