-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd scripts completely ignoring /etc/default/{{package-name}}
#737
Comments
Thanks for the good research. First you are right Which brings me to |
@muuki88 you bet! Thanks for this plugin! I'd be happy to make a PR, too. I just wanted to discuss the right solution before laying down some code. I was trying to read the differences between However, if we do want to source environment variables from Maybe something like this (although we would create a new template, not modify the existing) diff --git a/src/main/resources/com/typesafe/sbt/packager/archetypes/etc-default-template b/src/main/resources/com/typesafe/sbt/packager/archetypes/etc-default-template
index 4239217..659b06f 100644
--- a/src/main/resources/com/typesafe/sbt/packager/archetypes/etc-default-template
+++ b/src/main/resources/com/typesafe/sbt/packager/archetypes/etc-default-template-systemd
@@ -18,15 +18,13 @@
# ${{daemon_user}} daemon user
# -------------------------------------------------
+# This file is source by SystemD, and is not interpretted by the Bourne Shell
+# Interpretter.
+
# Setting JAVA_OPTS
# -----------------
-# JAVA_OPTS="-Dpidfile.path=/var/run/${{app_name}}/play.pid $JAVA_OPTS"
+# JAVA_OPTS="-Dpidfile.path=/var/run/${{app_name}}/play.pid"
# Setting PIDFILE
# ---------------
# PIDFILE="/var/run/${{app_name}}/play.pid"
-
-# export env vars for 3rd party libs
-# ----------------------------------
-# COMPANY_API_KEY=123abc
-# export COMPANY_API_KEY |
Oh, that's interesting. This would indeed require a new template. In your diff I see that you also removed the example to
It seems there are a few difference depending on the OS where SystemD files should be put. However until now we didn't get any feedback that some hasn't actually not worked. Only that "it's not best practice to put x in y on OS z" |
My original comment quotes the section from the man page in which the |
Yes, I found it. From my side everything is clear on how things should work. Do you have any questions? |
I think it's clear for me, too. Plan is to create a SystemD specific environment file template, modify the comments to make it appropriate for SystemD (with instructions to see |
starting work on this now |
This change modifies the SystemD template to include the packaged /etc/default environment settings file. Since a sourced SystemD environment file is not the same thing as a bourne shell source script, a different template is used. Those deploying their package to multiple platforms can also specify different /etc/default templates by suffixing `-systemd` to their name, ie: src/templates/etc-default-systemd
This change modifies the SystemD template to include the packaged /etc/default environment settings file. Since a sourced SystemD environment file is not the same thing as a bourne shell source script, a different template is used. Those deploying their package to multiple platforms can also specify different /etc/default templates by suffixing `-systemd` to their name, ie: src/templates/etc-default-systemd
This change modifies the SystemD template to include the packaged /etc/default environment settings file. Since a sourced SystemD environment file is not the same thing as a bourne shell source script, a different template is used. Those deploying their package to multiple platforms can also specify different /etc/default templates by suffixing `-systemd` to their name, ie: src/templates/etc-default-systemd
This change modifies the SystemD template to include the packaged /etc/default environment settings file. Since a sourced SystemD environment file is not the same thing as a bourne shell source script, a different template is used. Those deploying their package to multiple platforms can also specify different /etc/default templates by suffixing `-systemd` to their name, ie: src/templates/etc-default-systemd
This change modifies the SystemD template to include the packaged /etc/default environment settings file. Since a sourced SystemD environment file is not the same thing as a bourne shell source script, a different template is used. Those deploying their package to multiple platforms can also specify different /etc/default templates by suffixing `-systemd` to their name, ie: src/templates/etc-default-systemd
@timcharper I've just seen your contribution to this project. Awesome work! It"s exactly what i need right now. |
Yes, that is the intention |
The package is including the file, and SystemV scripts properly reference it, but the
SystemD
template is completely ignoring it.Perhaps it should set the EnvironmentFile EnvironmentFile directive?
I'm not sure what the drawbacks are. Seems like some people prefer
/etc/sysconfig
, and others prefer just adding service.d files.¯_(ツ)_/¯
The text was updated successfully, but these errors were encountered: