Sbt Native Packager Debian installation uses root user instead of daemon user -
i creating debian package of scala play 2.3.8 application sbt native packager ("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0"
). startscripts being generated use custom user start , stop app intended. problem is, installation dpkg -i package.deb
seems start app directly after installation root user. /var/run/neeedo-app/running.pid
owned root user , further stop or start attempts fail because file cant overwritten daemon user.
this build.sbt:
import com.typesafe.sbt.sbtnativepackager._ import nativepackagerkeys._ import com.typesafe.sbt.packager.archetypes.serverloader.systemv name := """neeedo-api""" version := "1.0-snapshot" scalaversion := "2.11.1" maintainer in debian := "neeedo-team <neeedo@neeedo.com>" packagesummary in debian := "neeedo api application" serverloading in debian := systemv packagedescription := "neeedo api application" daemonuser in linux := neeedo-api daemongroup in linux := neeedo-api
i running dpkg install command neeedo-app user. don't understand why running.pid file created root user after installation. if delete file manually sudo , use start/stop script afterswords works fine...
edit (answer): seems starting app root(with dpkg) not issue. running.pid file in directory owned app user. therefore can edit , delete pid file.
my application using environment variables in config , when run start script sudo root user have different environment variables. led fact the app couldn't start , unfortunately no error reporting visible (i have investigate further see why because should reported).