Skip to content

Commit

Permalink
init.d env variable declaration at global level
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvind Agarwal authored and Arvind Agarwal committed Feb 16, 2015
1 parent a44cc5d commit 3f0190f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "forever-service",
"version": "0.4.4",
"version": "0.4.5",
"preferGlobal": "true",
"description": "Provision node script as a service via forever, allowing it to automatically start on boot, working across various Linux distros and OS",
"main": "lib/api.js",
Expand Down
8 changes: 7 additions & 1 deletion templates/sysvinit/initd.template
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
# CLI {{cli}}
# Working Directory {{cwd}}

#Setup Environment variables (if any)
{%- if envVarsArray|default(false) %}
{%- for v in envVarsArray %}
export {{ v }}
{%- endfor %}
{%- endif %}

# Check if any of $pid (could be plural) are running
PIDFILE="/var/run/{{service}}.pid"
LOGFILE="/var/log/{{service}}.log"
Expand Down Expand Up @@ -88,7 +95,6 @@ start() {
ulimit -u 32000
{% endif %}

{{envVars|default('')}} \
{{foreverPath}}forever \
--pidFile $PIDFILE \
-a \
Expand Down

0 comments on commit 3f0190f

Please sign in to comment.