Skip to content

Commit

Permalink
FIX #856 Add documentation for daemonUser/Group settings
Browse files Browse the repository at this point in the history
  • Loading branch information
muuki88 committed Apr 26, 2017
1 parent fc1c89d commit 4b2fca2
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ object LinuxPlugin extends AutoPlugin {
name in Linux := name.value,
packageName in Linux := packageName.value,
executableScriptName in Linux := executableScriptName.value,
daemonUser in Linux := (packageName in Linux).value,
daemonUser := (packageName in Linux).value,
daemonUser in Linux := daemonUser.value,
daemonUserUid in Linux := None,
daemonGroup in Linux := (daemonUser in Linux).value,
daemonGroup := (daemonUser in Linux).value,
daemonGroup in Linux := daemonGroup.value,
daemonGroupGid in Linux := None,
daemonShell in Linux := "/bin/false",
defaultLinuxInstallLocation := "/usr/share",
Expand Down
22 changes: 22 additions & 0 deletions src/sphinx/archetypes/java_server/customize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ Example `/etc/default/<normalizedName>` for SystemV:
COMPANY_API_KEY=123abc
export COMPANY_API_KEY
Daemon User and Group
~~~~~~~~~~~~~~~~~~~~~

Customize the daemon user and group for your application with the following settings.

.. code-block:: scala
// a different daemon user
daemonUser in Linux := "my-user"
// if there is an existing one you can specify the uid
daemonUserUid in Linux := Some("123")
// a different daemon group
daemonGroup in Linux := "my-group"
// if the group already exists you can specify the uid
daemonGroupGid in Linux := Some("1001")
Environment variables
~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -225,6 +240,13 @@ Linux Replacements
${{daemon_user}}
${{daemon_group}}
.. attention::
Every replacement corresponds to a single setting or task. For the `linuxScriptReplacements` you need
to override the setting/task in the `in Linux` scope. For example

``daemonUser in Linux := "new-user"``

overrides the ``daemon_user`` in the linuxScriptReplacements.

Example Configurations
======================
Expand Down
2 changes: 1 addition & 1 deletion src/sphinx/archetypes/java_server/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ have sensible defaults.
UID of daemonUser

``daemonGroup``
Group to place daemonUser to.
Group to place daemonUser to

``daemonGroupGid``
GID of daemonGroup
Expand Down
3 changes: 0 additions & 3 deletions src/sphinx/archetypes/systemloaders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ General Settings
``retryTimeout``
Timeout between retries in seconds

``fileDescriptorLimit``
Maximum number of open file descriptors for the spawned application. The default value is 1024.


SystemV
-------
Expand Down
2 changes: 1 addition & 1 deletion src/sphinx/formats/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Since ``dockerCommands`` is just a ``Sequence``, adding commands is straightforw
import com.typesafe.sbt.packager.docker._
// use += to add an item to a Sequence
dockerCommands += Cmd("USER", daemonUser.value)
dockerCommands += Cmd("USER", (daemonUser in Docker).value)
// use ++= to merge a sequence with an existing sequence
dockerCommands ++= Seq(
Expand Down
4 changes: 4 additions & 0 deletions src/sphinx/formats/linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ The required fields for any linux distribution are:
``linuxPackageMappings``
A list of files and their desired installation locations for the package, as well as other metainformation.

``fileDescriptorLimit``
Maximum number of open file descriptors for the spawned application. The default value is 1024.



Customize
---------
Expand Down

0 comments on commit 4b2fca2

Please sign in to comment.