Skip to content

Commit 4b2fca2

Browse files
committed
FIX #856 Add documentation for daemonUser/Group settings
1 parent fc1c89d commit 4b2fca2

File tree

6 files changed

+32
-7
lines changed

6 files changed

+32
-7
lines changed

src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala

+4-2
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ object LinuxPlugin extends AutoPlugin {
6060
name in Linux := name.value,
6161
packageName in Linux := packageName.value,
6262
executableScriptName in Linux := executableScriptName.value,
63-
daemonUser in Linux := (packageName in Linux).value,
63+
daemonUser := (packageName in Linux).value,
64+
daemonUser in Linux := daemonUser.value,
6465
daemonUserUid in Linux := None,
65-
daemonGroup in Linux := (daemonUser in Linux).value,
66+
daemonGroup := (daemonUser in Linux).value,
67+
daemonGroup in Linux := daemonGroup.value,
6668
daemonGroupGid in Linux := None,
6769
daemonShell in Linux := "/bin/false",
6870
defaultLinuxInstallLocation := "/usr/share",

src/sphinx/archetypes/java_server/customize.rst

+22
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@ Example `/etc/default/<normalizedName>` for SystemV:
5454
COMPANY_API_KEY=123abc
5555
export COMPANY_API_KEY
5656
57+
Daemon User and Group
58+
~~~~~~~~~~~~~~~~~~~~~
59+
60+
Customize the daemon user and group for your application with the following settings.
61+
62+
.. code-block:: scala
63+
64+
// a different daemon user
65+
daemonUser in Linux := "my-user"
66+
// if there is an existing one you can specify the uid
67+
daemonUserUid in Linux := Some("123")
68+
// a different daemon group
69+
daemonGroup in Linux := "my-group"
70+
// if the group already exists you can specify the uid
71+
daemonGroupGid in Linux := Some("1001")
5772
5873
Environment variables
5974
~~~~~~~~~~~~~~~~~~~~~
@@ -225,6 +240,13 @@ Linux Replacements
225240
${{daemon_user}}
226241
${{daemon_group}}
227242
243+
.. attention::
244+
Every replacement corresponds to a single setting or task. For the `linuxScriptReplacements` you need
245+
to override the setting/task in the `in Linux` scope. For example
246+
247+
``daemonUser in Linux := "new-user"``
248+
249+
overrides the ``daemon_user`` in the linuxScriptReplacements.
228250

229251
Example Configurations
230252
======================

src/sphinx/archetypes/java_server/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ have sensible defaults.
4646
UID of daemonUser
4747

4848
``daemonGroup``
49-
Group to place daemonUser to.
49+
Group to place daemonUser to
5050

5151
``daemonGroupGid``
5252
GID of daemonGroup

src/sphinx/archetypes/systemloaders.rst

-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ General Settings
4949
``retryTimeout``
5050
Timeout between retries in seconds
5151

52-
``fileDescriptorLimit``
53-
Maximum number of open file descriptors for the spawned application. The default value is 1024.
54-
5552

5653
SystemV
5754
-------

src/sphinx/formats/docker.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Since ``dockerCommands`` is just a ``Sequence``, adding commands is straightforw
258258
import com.typesafe.sbt.packager.docker._
259259
260260
// use += to add an item to a Sequence
261-
dockerCommands += Cmd("USER", daemonUser.value)
261+
dockerCommands += Cmd("USER", (daemonUser in Docker).value)
262262
263263
// use ++= to merge a sequence with an existing sequence
264264
dockerCommands ++= Seq(

src/sphinx/formats/linux.rst

+4
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ The required fields for any linux distribution are:
8282
``linuxPackageMappings``
8383
A list of files and their desired installation locations for the package, as well as other metainformation.
8484

85+
``fileDescriptorLimit``
86+
Maximum number of open file descriptors for the spawned application. The default value is 1024.
87+
88+
8589

8690
Customize
8791
---------

0 commit comments

Comments
 (0)