I have a scala SBT project where I'm using the native packager plugin. I'm bundling as a JavaServerAppPackaging
and would like to generate scripts for automatically registering the application for startup and shutdown with rc.d
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(serverModuleDeps)
.settings(ServerSettings.allSettings: _*)
.settings(CloudFormation.defaultSettings: _*)
.settings(serverLoading in Universal := Option(ServerLoader.SystemV))
.settings(serviceAutostart:=true)
.settings(startRunlevels:=Option("3"))
.settings(stopRunlevels:=Option("3"))
.settings(stackRegion := "US_WEST_2")
.settings(codedeployAWSCredentialsProvider := Option(new ProfileCredentialsProvider("devcredentialsprovider")))
.dependsOn(sharedJvm)
.dependsOn(langJVM)
.enablePlugins(JavaServerAppPackaging, SystemVPlugin)
.settings(daemonUser:="ec2-user")
.configure(InBrowserTesting.jvm)
when I run sbt stage
I can see a universal
folder containing a bin
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: https://github.com/MojoJojo/sbt-native-packager-test
debian:packageBin
command. – kardapoltsev