Skip to content

Commit 00b4942

Browse files
committed
Merge pull request #106 from muuki88/wip_server_defaults
Default values for packageArchetype.java_server
2 parents 85c0b23 + b9ab24e commit 00b4942

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ Here's what to add to your `build.sbt`:
6868

6969
packageArchetype.java_server
7070

71+
For debian packaging there are a few things generated for you
72+
73+
* A template folder `/var/log/<app-name>`
74+
* A symlink `/installdir/<app-name>/logs` to `/var/log/<app-name` (Installdir is by default `/usr/share`)
75+
* Default `serverLoading` is `Upstart` (you can choose SystemV with `com.typesafe.sbt.packager.archetypes.ServerLoader.SystemV` )
76+
* Default `daemonUser` is _root_ (only relevant for SystemV)
77+
* If you choose different permissions than the default ones for your packages, _add-user_ and _remove-user_ statements will be added to
78+
the `postrm` and `postinst` control files
7179

7280
### By-hand packaging ###
7381

src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ object JavaServerAppPackaging {
2525

2626
def debianSettings: Seq[Setting[_]] =
2727
Seq(
28+
serverLoading := Upstart,
29+
daemonUser := "root",
2830
debianStartScriptReplacements <<= (
2931
maintainer in Debian, packageSummary in Debian, serverLoading in Debian, daemonUser in Debian, normalizedName,
3032
sbt.Keys.version, defaultLinuxInstallLocation, mainClass in Compile, scriptClasspath)
3133
map { (author, descr, loader, daemonUser, name, version, installLocation, mainClass, cp) =>
32-
// TODO name-version is copied from UniversalPlugin. This should be consolidated into a setting (install location...)
3334
val appDir = installLocation + "/" + name
3435
val appClasspath = cp.map(appDir + "/lib/" + _).mkString(":")
3536

0 commit comments

Comments
 (0)