From b6111a1bdcced445101aae33ae7e66c0c7a84357 Mon Sep 17 00:00:00 2001 From: Emile Cantin Date: Wed, 25 Apr 2012 11:07:35 -0400 Subject: [PATCH] Corrected in template --- data/export/initscript/master.erb | 7 +++---- spec/resources/export/initscript/app | 9 ++++----- spec/resources/export/initscript/app-concurrency | 9 ++++----- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/data/export/initscript/master.erb b/data/export/initscript/master.erb index 8ee9e53..f9cc6a8 100644 --- a/data/export/initscript/master.erb +++ b/data/export/initscript/master.erb @@ -19,7 +19,6 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="Runs <%= app %>" NAME=<%= app %> PIDDIR=/var/run/$NAME -LOGDIR=<%= log_root %> SCRIPTNAME=/etc/init.d/$NAME USERNAME=<%= user %> @@ -40,8 +39,8 @@ USERNAME=<%= user %> do_start() { mkdir -p $PIDDIR - mkdir -p $LOGDIR - chown $USERNAME: $LOGDIR + mkdir -p <%= log_root %> + chown $USERNAME: <%= log_root %> # START APPLICATION: <%= app %> <% engine.procfile.entries.each do |process| %> # START PROCESS: <%= process.name %> @@ -49,7 +48,7 @@ do_start() # START CONCURRENT: <%= num %> # Start: <%= app %>.<%= process.name %>.<%= num %> # Create $PIDDIR/<%= process.name %>.<%= num %>.pid - su - $USERNAME -c 'cd <%= engine.directory %>; export PORT=<%= engine.port_for(process, num, self.port) %>;<% engine.environment.each_pair do |var,env| %> export <%= var.upcase %>=<%= env %>; <% end %> <%= process.command %> >> $LOGDIR/<%=process.name%>-<%=num%>.log 2>&1 & echo $!' > $PIDDIR/<%= process.name %>.<%= num %>.pid + su - $USERNAME -c 'cd <%= engine.directory %>; export PORT=<%= engine.port_for(process, num, self.port) %>;<% engine.environment.each_pair do |var,env| %> export <%= var.upcase %>=<%= env %>; <% end %> <%= process.command %> >> <%= log_root %>/<%=process.name%>-<%=num%>.log 2>&1 & echo $!' > $PIDDIR/<%= process.name %>.<%= num %>.pid <% end %> <% end %> diff --git a/spec/resources/export/initscript/app b/spec/resources/export/initscript/app index 8d8f091..31c168d 100644 --- a/spec/resources/export/initscript/app +++ b/spec/resources/export/initscript/app @@ -19,7 +19,6 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="Runs app" NAME=app PIDDIR=/var/run/$NAME -LOGDIR=/var/log/app SCRIPTNAME=/etc/init.d/$NAME USERNAME=app @@ -40,8 +39,8 @@ USERNAME=app do_start() { mkdir -p $PIDDIR - mkdir -p $LOGDIR - chown $USERNAME: $LOGDIR + mkdir -p /var/log/app + chown $USERNAME: /var/log/app # START APPLICATION: app # START PROCESS: alpha @@ -49,7 +48,7 @@ do_start() # START CONCURRENT: 1 # Start: app.alpha.1 # Create $PIDDIR/alpha.1.pid - su - $USERNAME -c 'cd /tmp/app; export PORT=5000; ./alpha >> $LOGDIR/alpha-1.log 2>&1 & echo $!' > $PIDDIR/alpha.1.pid + su - $USERNAME -c 'cd /tmp/app; export PORT=5000; ./alpha >> /var/log/app/alpha-1.log 2>&1 & echo $!' > $PIDDIR/alpha.1.pid # START PROCESS: bravo @@ -57,7 +56,7 @@ do_start() # START CONCURRENT: 1 # Start: app.bravo.1 # Create $PIDDIR/bravo.1.pid - su - $USERNAME -c 'cd /tmp/app; export PORT=5100; ./bravo >> $LOGDIR/bravo-1.log 2>&1 & echo $!' > $PIDDIR/bravo.1.pid + su - $USERNAME -c 'cd /tmp/app; export PORT=5100; ./bravo >> /var/log/app/bravo-1.log 2>&1 & echo $!' > $PIDDIR/bravo.1.pid diff --git a/spec/resources/export/initscript/app-concurrency b/spec/resources/export/initscript/app-concurrency index 88de185..3a99029 100644 --- a/spec/resources/export/initscript/app-concurrency +++ b/spec/resources/export/initscript/app-concurrency @@ -19,7 +19,6 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="Runs app" NAME=app PIDDIR=/var/run/$NAME -LOGDIR=/var/log/app SCRIPTNAME=/etc/init.d/$NAME USERNAME=app @@ -40,8 +39,8 @@ USERNAME=app do_start() { mkdir -p $PIDDIR - mkdir -p $LOGDIR - chown $USERNAME: $LOGDIR + mkdir -p /var/log/app + chown $USERNAME: /var/log/app # START APPLICATION: app # START PROCESS: alpha @@ -49,13 +48,13 @@ do_start() # START CONCURRENT: 1 # Start: app.alpha.1 # Create $PIDDIR/alpha.1.pid - su - $USERNAME -c 'cd /tmp/app; export PORT=5000; ./alpha >> $LOGDIR/alpha-1.log 2>&1 & echo $!' > $PIDDIR/alpha.1.pid + su - $USERNAME -c 'cd /tmp/app; export PORT=5000; ./alpha >> /var/log/app/alpha-1.log 2>&1 & echo $!' > $PIDDIR/alpha.1.pid # START CONCURRENT: 2 # Start: app.alpha.2 # Create $PIDDIR/alpha.2.pid - su - $USERNAME -c 'cd /tmp/app; export PORT=5001; ./alpha >> $LOGDIR/alpha-2.log 2>&1 & echo $!' > $PIDDIR/alpha.2.pid + su - $USERNAME -c 'cd /tmp/app; export PORT=5001; ./alpha >> /var/log/app/alpha-2.log 2>&1 & echo $!' > $PIDDIR/alpha.2.pid # START PROCESS: bravo