diff --git a/src/sphinx/archetypes/cheatsheet.rst b/src/sphinx/archetypes/cheatsheet.rst index 428d8c3f9..94b3fd5c9 100644 --- a/src/sphinx/archetypes/cheatsheet.rst +++ b/src/sphinx/archetypes/cheatsheet.rst @@ -98,7 +98,7 @@ For a bash script this could look like this. """addJava "-Xmx2048m"""" ) -For information take a look at the :doc:` customize section for java apps ` +For more information take a look at the :ref:`according documentation`. File - application.ini or etc-default ------------------------------------- diff --git a/src/sphinx/archetypes/java_app/customize.rst b/src/sphinx/archetypes/java_app/customize.rst index b70ddce4d..9323a4e40 100644 --- a/src/sphinx/archetypes/java_app/customize.rst +++ b/src/sphinx/archetypes/java_app/customize.rst @@ -123,6 +123,7 @@ The default configuration looks like this bashScriptConfigLocation := Some("${app_home}/../conf/application.ini") batScriptConfigLocation := Some("%APP_HOME%\\conf\\application.ini") +.. _add-code-to-the-start-scripts: Add code to the start scripts ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/sphinx/recipes/index.rst b/src/sphinx/recipes/index.rst index 45ebe978f..b61bc2c99 100644 --- a/src/sphinx/recipes/index.rst +++ b/src/sphinx/recipes/index.rst @@ -17,5 +17,6 @@ This section provides recipes for common configurations. If you can't find what scalajs package_configuration embedded-jvm + umask .. _sbt-native-packager examples: https://github.com/muuki88/sbt-native-packager-examples diff --git a/src/sphinx/recipes/umask.rst b/src/sphinx/recipes/umask.rst index 25594e750..76bb8b735 100644 --- a/src/sphinx/recipes/umask.rst +++ b/src/sphinx/recipes/umask.rst @@ -3,18 +3,36 @@ Setting the umask for your process ================================== -When using the :ref:`java-server-plugin`, the umask, associated with the user running the process, -will determine what permissions files generated by the process, such as log file, will have. Usually the system default umask -for daemons is fine and can be left unchanged, however sometime the need arises to oerride it. +In Linux, the umask, associated with the user running the process, will determine what permissions files generated by the process, +such as log files, will have. + +Within the start script +------------------------------------- + +You can set the umask within the generated start script: + +.. code-block:: scala + + bashScriptExtraDefines += "umask 077" + +This line will be added just before the application will be executed by the start script and therefore the application process +will also inhert this umask. For more information take a look at the :ref:`according documentation`. + +.. hint:: When using :ref:`Docker` this is the only reliable way `right now `_ to set the umask for the process. Docker `will ignore `_ any umask set in e.g. `/etc/login.defs` (or other config files) within a docker image. System V/systemd ---------------- -To set a custom umask for your application that is running either via a System V init script or systemd, the umask can be -specified via a custom ``/etc/default/appname`` file. The contents of this file can be specified by creating a template at -``src/templates/etc-default`` and adding a line such as the following: +When using the :ref:`java-server-plugin` usually the system default umask for daemons is fine and can be left unchanged, +however sometime the need arises to override it. + +As an alternative to the start script approach described in the section above, to set a custom umask for +your application that is running either via a System V init script or systemd, the umask can be specified via +a custom ``/etc/default/appname`` file. + +The contents of this file can be specified by creating a template at ``src/templates/etc-default`` and adding a line such as the following: .. code-block:: bash - umask 022 + umask 077