Skip to content

Commit

Permalink
fixing backgroundjob script
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel committed May 9, 2008
1 parent 4b905ab commit 7a76473
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
7 changes: 6 additions & 1 deletion History.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
== 0.3.5 ?
== 0.3.6 ?

* Fixing backgroundjob to use --daemon

== 0.3.5 2008-05-08

* Adding merb:migrate recipe
* Fixing merb monitrc
* Added preview variables prompt
* Fixed merb logrotate defaults

== 0.3.4 2008-05-05

Expand Down
7 changes: 3 additions & 4 deletions lib/recipes/centos/backgroundjob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<dd class="default">Defaults to:
<pre>
\#{current_path}/script/bj --forever --rails_env=production --rails_root=\#{current_path} --redirect \
--redirect=\#{backgroundjob_log_path} --pidfile=\#{backgroundjob_pid_path} &
--redirect=\#{backgroundjob_log_path} --pidfile=\#{backgroundjob_pid_path} --daemon
</pre>
</dd>
<dt>backgroundjob_pid_path</dt>
Expand All @@ -30,10 +30,9 @@
fetch_or_default(:backgroundjob_log_path, "#{shared_path}/log/bj.log")

default_bin_path = "#{current_path}/script/bj run --forever --rails_env=production --rails_root=#{current_path} \
--redirect=#{backgroundjob_log_path} --pidfile=#{backgroundjob_pid_path} &"

fetch_or_default(:backgroundjob_bin_path, default_bin_path)
--redirect=#{backgroundjob_log_path} --pidfile=#{backgroundjob_pid_path} --daemon"

fetch_or_default(:backgroundjob_bin_path, default_bin_path)

# Install initscript
utils.install_template("backgroundjob/backgroundjob.initd.centos.erb", "/etc/init.d/backgroundjob_#{application}")
Expand Down
8 changes: 4 additions & 4 deletions lib/templates/backgroundjob/backgroundjob.initd.centos.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
RETVAL=0

DESC="backgroundjob daemon (<%= application %>)"
DAEMON="<%= backgroundjob_bin_path %>"
PIDFILE="<%= backgroundjob_pid_path %>"
BIN_PATH"<%= backgroundjob_bin_path %>"
PID_FILE="<%= backgroundjob_pid_path %>"

start() {
echo -n $"Starting $DESC: "
daemon --user sick --pidfile $PIDFILE $DAEMON
daemon --user sick $BIN_PATH
RETVAL=$?
echo
return $RETVAL;
}

stop() {
echo -n $"Stopping $DESC:"
killproc -p $PIDFILE
killproc -p $PID_FILE
RETVAL=$?
echo
return $RETVAL;
Expand Down

0 comments on commit 7a76473

Please sign in to comment.