scala - Play framework create DEB and deploy it on Ubuntu 14.04 -


i'm using play framework 2.3.8 scala, , i'm trying create deb package install on prod server. after installation should automatically run thru "services"

i've added build.sbt:

import com.typesafe.sbt.packager.keys._  packagedescription := """admin application"""  maintainer := """admin <contact@maintainer.com>""" 

after executing

activator debian:packagebin 

it generates deb file, after installation script /etc/init.d/testapplication not working

how can make working on ubuntu 14.04?

i tried use java application archetype basing on http://www.scala-sbt.org/sbt-native-packager/archetypes/java_server/

i've added:

import com.typesafe.sbt.sbtnativepackager._ import nativepackagerkeys._  packagearchetype.java_application 

but sill without success

===== update

after setting upstart, during installation i'm getting:

selecting unselected package testapplication. (reading database ... 61317 files , directories installed.) preparing unpack testapplication_0.1_all.deb ... unpacking testapplication (0.1) ... setting testapplication (0.1) ... creating system group: testapplication adding group `testapplication' (gid 115) ... done. creating user testapplication in group testapplication start: unknown job: testapplication testapplication not started. try manually service testapplication start processing triggers ureadahead (0.100.0-16) ... 

and running script manually still doesn't give results

michal@cantrace:~$ sudo /etc/init.d/testapplication start  * starting testapplication                                  [ ok ] michal@cantrace:~$ ps aux |grep java michal    1807  0.0  0.0  11744   920 pts/0    s+   18:33   0:00 grep --color=auto java 

i encountered similar problem on debian. default configuration of deb package broken. default application create running_pid file in /usr/share/[your application name] on startup. fail due invalid file permission. fix:

  • after installing deb package, edit /etc/default/[your applicaiton name] , uncomment following line , restart service:

    -dpidfile.path=/var/run/[your application name]/play.pid

  • or, upgrade sbt-native-packager v1.0.0 , override default config.

to upgrade,

  1. in [project root]/project/plugins.sbt, add:

addsbtplugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0")

  1. in [project root]/build.sbt, remove following imports:

//import com.typesafe.sbt.sbtnativepackager._
//import nativepackagerkeys._

  1. create [project root]/dist/conf/application.ini , specify new defaults:

# since play uses separate pidfile have provide proper path
-dpidfile.path=/var/run/[your application name]/play.pid

hope helps.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -