Skip to content
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

Multiple issues building debian for Systemd from play application #1050

Closed
dimon37 opened this issue Oct 23, 2017 · 1 comment
Closed

Multiple issues building debian for Systemd from play application #1050

dimon37 opened this issue Oct 23, 2017 · 1 comment

Comments

@dimon37
Copy link

dimon37 commented Oct 23, 2017

I'm trying to create .deb file for Xenial Ubuntu (Systemd systemloader) for Play application
The result has two major issues:

  • myproject.service file is only created when I use rpm:packageBin and NOT when I use debian:packageBin command for SBT.
  • /usr/share/myproject/bin folder (where actual start script should reside) is not created, start script is not created anywhere else either

Using SBT 0.13.15, sbt-native-packager 1.2.2
My build.sbt looks like this:

import sbt._
import com.typesafe.sbt.packager.archetypes.systemloader.SystemdPlugin
import com.typesafe.sbt.packager.archetypes._

// ordering appears to be important with some versions of sbt and its plugins
// don't change the order below without a review first

//packageArchetype.java_server
enablePlugins(JavaServerAppPackaging)
enablePlugins(SystemdPlugin)
//serverLoading := Systemd

organization := "myorganization"

name := "myproject"

version := "7.5.0.1"

scalaVersion := "2.11.2"

packageDescription in Rpm := "Myproject Service"

packageDescription in Debian := "Myproject Service"

defaultLinuxStartScriptLocation in Rpm := "/lib/systemd/system"

defaultLinuxStartScriptLocation in Debian := "/lib/systemd/system"

name in Debian := "myproject"

rpmVendor := "MyOrganization"

rpmGroup := Some("Integration")

rpmLicense := Some("Apache 2.0")

packageSummary in Linux := "Myproject Service"```

What am I missing?

@muuki88 muuki88 added the debian label Oct 24, 2017
@muuki88
Copy link
Contributor

muuki88 commented Nov 2, 2017

Hi,

I can't reproduce this issue. I created a test project with your build.sbt and a plugins.sbt without play.
My plugins.sbt

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

When I do

$ sbt debian:stage

And display the generated files

$ tree target/myproject-7.5.0.1 
target/myproject-7.5.0.1
├── DEBIAN
│   ├── conffiles
│   ├── control
│   ├── postinst
│   ├── postrm
│   ├── preinst
│   └── prerm
├── etc
│   └── default
│       └── myproject
├── lib
│   └── systemd
│       └── system
│           └── myproject.service
├── usr
│   └── share
│       └── myproject
│           ├── lib
│           │   ├── myorganization.myproject-7.5.0.1.jar
│           │   └── org.scala-lang.scala-library-2.11.2.jar
│           └── logs -> /var/log/myproject
└── var
    └── log
        └── myproject

everything looks fine. The generated debian file also contains the correct systemd file.

As a side note. With sbt 0.13.15 you don't need blank lines between your settings.
Also when using the AutoPlugins the ordering is not crucial anymore ( ordering still
applies, but AutoPlugins enable themselves at the correct time )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants