Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Adding Upstart files, ensure jobs run after reboot

  • Loading branch information...
commit 71e631ea23e368682f2c8fc80045c9692ef1a17a 1 parent 4d8bd66
Swaroop C H authored July 29, 2011
12  README.textile
Source Rendered
@@ -28,7 +28,19 @@ h2. Rails
28 28
 
29 29
 h2. delayed_job
30 30
 
  31
+For development:
  32
+
  33
+@foreman start@
  34
+
  35
+For Ubuntu Linux / production:
  36
+
  37
+Edit @CODEDIR@ path in @upstart/isbn.net.in-job-1.conf@
  38
+@sudo cp -v upstart/* /etc/init/@
  39
+@sudo start isbn.net.in@
  40
+
  41
+<!--
31 42
 @mkdir -p tmp@
32 43
 @foreman -u <your username> export upstart tmp@
33 44
 @sudo cp -v tmp/isbn.net.in*.conf /etc/init/@
34 45
 @sudo start isbn.net.in@
  46
+-->
9  upstart/isbn.net.in-job-1.conf
... ...
@@ -0,0 +1,9 @@
  1
+start on starting isbn.net.in-job
  2
+stop on stopping isbn.net.in-job
  3
+respawn
  4
+
  5
+env CODEDIR="/home/swaroop/web/isbn.net.in/private/isbn.net.in"
  6
+
  7
+exec su -l swaroop -c "cd $CODEDIR; export PORT=5000; bundle exec rake RAILS_ENV=production jobs:work >> /var/log/isbn.net.in/job-1.log 2>&1"
  8
+
  9
+# vim: ft=upstart
4  upstart/isbn.net.in-job.conf
... ...
@@ -0,0 +1,4 @@
  1
+start on starting isbn.net.in
  2
+stop on stopping isbn.net.in
  3
+
  4
+# vim: ft=upstart
14  upstart/isbn.net.in.conf
... ...
@@ -0,0 +1,14 @@
  1
+
  2
+start on (local-filesystems and net-device-up IFACE!=lo)
  3
+stop on runlevel [016]
  4
+
  5
+pre-start script
  6
+
  7
+bash << "EOF"
  8
+  mkdir -p /var/log/isbn.net.in
  9
+  chown -R swaroop /var/log/isbn.net.in
  10
+EOF
  11
+
  12
+end script
  13
+
  14
+# vim: ft=upstart

0 notes on commit 71e631e

Please sign in to comment.
Something went wrong with that request. Please try again.