Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 49 lines (36 sloc) 0.964 kb
31271407 »
2010-04-18 First commit
1 With PID
2 ========
4ab38af8 »
2009-11-06 [gem_template] First commit
3
31271407 »
2010-04-18 First commit
4 The simple way to create and monitor a Ruby daemon.
5
6 Works by generating a bash file and executing it instead of doing any Ruby process tricks.
4ab38af8 »
2009-11-06 [gem_template] First commit
7
085cb142 »
2009-11-09 [gem_template] Updating README
8 Requirements
9 ------------
4ab38af8 »
2009-11-06 [gem_template] First commit
10
11 <pre>
31271407 »
2010-04-18 First commit
12 sudo gem install with_pid
4ab38af8 »
2009-11-06 [gem_template] First commit
13 </pre>
14
31271407 »
2010-04-18 First commit
15 Ruby script
16 -----------
4ab38af8 »
2009-11-06 [gem_template] First commit
17
31290fc8 »
2010-04-18 README
18 ### /data/my_app/current/bin/dj
085cb142 »
2009-11-09 [gem_template] Updating README
19
20 <pre>
31271407 »
2010-04-18 First commit
21 #!/usr/bin/env ruby
22
23 require 'rubygems'
24 require 'with_pid'
25
26 with_pid(
27 :action => ARGV[0], # start or stop
28 :command => "/data/my_app/current/script/runner 'Delayed::Worker.new.start'",
29 :name => "dj",
30 :pid => "/var/run/dj/dj.pid",
31 :tmp => "/data/my_app/current/tmp",
32 :user => "deploy"
33 )
085cb142 »
2009-11-09 [gem_template] Updating README
34 </pre>
35
31271407 »
2010-04-18 First commit
36 Be sure to run <code>chmod +x /data/my_app/current/bin/dj</code>.
085cb142 »
2009-11-09 [gem_template] Updating README
37
31271407 »
2010-04-18 First commit
38 It is up to you to make sure that the command you execute runs in a continuous loop.
085cb142 »
2009-11-09 [gem_template] Updating README
39
31271407 »
2010-04-18 First commit
40 Monit
41 -----
085cb142 »
2009-11-09 [gem_template] Updating README
42
31271407 »
2010-04-18 First commit
43 <pre>
44 check process delayed_job
45 with pidfile /var/run/dj/dj.pid
46 start program = "/data/my_app/current/bin/dj start"
47 stop program = "/data/my_app/current/bin/dj stop"
48 group delayed_job
49 </pre>
Something went wrong with that request. Please try again.