hennk-hennk-ec2onrails 0.9.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +0 -0
- data/COPYING +339 -0
- data/Manifest +148 -0
- data/README.textile +214 -0
- data/Rakefile +36 -0
- data/TODO +5 -0
- data/ec2onrails.gemspec +44 -0
- data/lib/ec2onrails/capistrano_utils.rb +33 -0
- data/lib/ec2onrails/recipes.rb +460 -0
- data/lib/ec2onrails/version.rb +32 -0
- data/lib/ec2onrails.rb +20 -0
- data/server/build-ec2onrails.sh +44 -0
- data/server/files/etc/aliases +6 -0
- data/server/files/etc/aliases.db +0 -0
- data/server/files/etc/apache2/apache2.conf +295 -0
- data/server/files/etc/apache2/conf.d/app.proxy_cluster.conf +7 -0
- data/server/files/etc/apache2/conf.d/app.proxy_frontend.conf +10 -0
- data/server/files/etc/apache2/mods-available/proxy.conf +18 -0
- data/server/files/etc/apache2/sites-available/app.common +58 -0
- data/server/files/etc/apache2/sites-available/app.custom +0 -0
- data/server/files/etc/apache2/sites-available/default +17 -0
- data/server/files/etc/apache2/sites-available/default-ssl +18 -0
- data/server/files/etc/cron.d/backup_app_db_to_s3 +6 -0
- data/server/files/etc/cron.daily/app +5 -0
- data/server/files/etc/cron.daily/logrotate_post +27 -0
- data/server/files/etc/cron.hourly/app +5 -0
- data/server/files/etc/cron.monthly/app +5 -0
- data/server/files/etc/cron.weekly/app +5 -0
- data/server/files/etc/denyhosts.conf +628 -0
- data/server/files/etc/dpkg/dpkg.cfg +13 -0
- data/server/files/etc/ec2onrails/balancer_members +6 -0
- data/server/files/etc/ec2onrails/roles.yml +5 -0
- data/server/files/etc/environment +2 -0
- data/server/files/etc/event.d/monit +13 -0
- data/server/files/etc/init.d/ec2-every-startup +29 -0
- data/server/files/etc/init.d/ec2-first-startup +36 -0
- data/server/files/etc/init.d/mongrel +91 -0
- data/server/files/etc/init.d/set_roles +3 -0
- data/server/files/etc/logrotate.d/apache2 +13 -0
- data/server/files/etc/logrotate.d/mysql-server +23 -0
- data/server/files/etc/logrotate.d/rails +7 -0
- data/server/files/etc/memcached.conf +47 -0
- data/server/files/etc/mongrel_cluster/app.yml +9 -0
- data/server/files/etc/monit/app.monitrc +71 -0
- data/server/files/etc/monit/db_primary.monitrc +10 -0
- data/server/files/etc/monit/memcache.monitrc +8 -0
- data/server/files/etc/monit/monitrc +13 -0
- data/server/files/etc/monit/system.monitrc +15 -0
- data/server/files/etc/monit/web.monitrc +10 -0
- data/server/files/etc/motd.tail +13 -0
- data/server/files/etc/mysql/my.cnf +149 -0
- data/server/files/etc/postfix/main.cf +4 -0
- data/server/files/etc/rc0.d/K10mongrel +91 -0
- data/server/files/etc/rc1.d/K10mongrel +91 -0
- data/server/files/etc/rc2.d/S90mongrel +91 -0
- data/server/files/etc/rc3.d/S90mongrel +91 -0
- data/server/files/etc/rc4.d/S90mongrel +91 -0
- data/server/files/etc/rc5.d/S90mongrel +91 -0
- data/server/files/etc/rc6.d/K10mongrel +91 -0
- data/server/files/etc/rcS.d/S91ec2-first-startup +36 -0
- data/server/files/etc/rcS.d/S92ec2-every-startup +29 -0
- data/server/files/etc/rcS.d/S99set_roles +3 -0
- data/server/files/etc/ssh/sshd_config +94 -0
- data/server/files/etc/sudoers +24 -0
- data/server/files/etc/syslog.conf +69 -0
- data/server/files/usr/local/ec2onrails/COPYING +339 -0
- data/server/files/usr/local/ec2onrails/bin/archive_file.rb +44 -0
- data/server/files/usr/local/ec2onrails/bin/backup_app_db.rb +83 -0
- data/server/files/usr/local/ec2onrails/bin/backup_files.rb +51 -0
- data/server/files/usr/local/ec2onrails/bin/mongrel_start +8 -0
- data/server/files/usr/local/ec2onrails/bin/mongrel_stop +8 -0
- data/server/files/usr/local/ec2onrails/bin/rails_env +35 -0
- data/server/files/usr/local/ec2onrails/bin/rebundle.sh +70 -0
- data/server/files/usr/local/ec2onrails/bin/restore_app_db.rb +58 -0
- data/server/files/usr/local/ec2onrails/bin/restore_files.rb +59 -0
- data/server/files/usr/local/ec2onrails/bin/set_rails_env +40 -0
- data/server/files/usr/local/ec2onrails/bin/set_roles.rb +156 -0
- data/server/files/usr/local/ec2onrails/config +30 -0
- data/server/files/usr/local/ec2onrails/lib/mysql_helper.rb +101 -0
- data/server/files/usr/local/ec2onrails/lib/s3_helper.rb +126 -0
- data/server/files/usr/local/ec2onrails/lib/utils.rb +16 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/every-startup/get-hostname.sh +25 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/create-dirs.sh +39 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/generate-default-web-cert-and-key.sh +49 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/misc.sh +30 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/prepare-mysql-data-dir.sh +24 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/setup_credentials.sh +33 -0
- data/server/rakefile.rb +245 -0
- data/setup.rb +1585 -0
- data/test/autobench.conf +60 -0
- data/test/spec/lib/s3_helper_spec.rb +134 -0
- data/test/spec/lib/s3_old.yml +3 -0
- data/test/spec/test_files/test1 +0 -0
- data/test/spec/test_files/test2 +0 -0
- data/test/test_app/Capfile +3 -0
- data/test/test_app/README +182 -0
- data/test/test_app/Rakefile +10 -0
- data/test/test_app/app/controllers/application.rb +7 -0
- data/test/test_app/app/controllers/db_fast_controller.rb +6 -0
- data/test/test_app/app/controllers/fast_controller.rb +5 -0
- data/test/test_app/app/controllers/slow_controller.rb +6 -0
- data/test/test_app/app/controllers/very_slow_controller.rb +6 -0
- data/test/test_app/app/helpers/application_helper.rb +3 -0
- data/test/test_app/app/helpers/db_fast_helper.rb +2 -0
- data/test/test_app/app/helpers/fast_helper.rb +2 -0
- data/test/test_app/app/helpers/slow_helper.rb +2 -0
- data/test/test_app/app/helpers/very_slow_helper.rb +2 -0
- data/test/test_app/config/boot.rb +109 -0
- data/test/test_app/config/database.yml +36 -0
- data/test/test_app/config/deploy.rb +21 -0
- data/test/test_app/config/environment.rb +60 -0
- data/test/test_app/config/environments/development.rb +21 -0
- data/test/test_app/config/environments/production.rb +18 -0
- data/test/test_app/config/environments/test.rb +19 -0
- data/test/test_app/config/routes.rb +27 -0
- data/test/test_app/db/schema.rb +7 -0
- data/test/test_app/doc/README_FOR_APP +2 -0
- data/test/test_app/public/404.html +30 -0
- data/test/test_app/public/500.html +30 -0
- data/test/test_app/public/dispatch.cgi +10 -0
- data/test/test_app/public/dispatch.fcgi +24 -0
- data/test/test_app/public/dispatch.rb +10 -0
- data/test/test_app/public/favicon.ico +0 -0
- data/test/test_app/public/images/rails.png +0 -0
- data/test/test_app/public/javascripts/application.js +2 -0
- data/test/test_app/public/javascripts/controls.js +963 -0
- data/test/test_app/public/javascripts/dragdrop.js +972 -0
- data/test/test_app/public/javascripts/effects.js +1120 -0
- data/test/test_app/public/javascripts/prototype.js +4225 -0
- data/test/test_app/public/robots.txt +1 -0
- data/test/test_app/script/about +3 -0
- data/test/test_app/script/breakpointer +3 -0
- data/test/test_app/script/console +3 -0
- data/test/test_app/script/destroy +3 -0
- data/test/test_app/script/generate +3 -0
- data/test/test_app/script/performance/benchmarker +3 -0
- data/test/test_app/script/performance/profiler +3 -0
- data/test/test_app/script/performance/request +3 -0
- data/test/test_app/script/plugin +3 -0
- data/test/test_app/script/process/inspector +3 -0
- data/test/test_app/script/process/reaper +3 -0
- data/test/test_app/script/process/spawner +3 -0
- data/test/test_app/script/runner +3 -0
- data/test/test_app/script/server +3 -0
- data/test/test_app/test/functional/db_fast_controller_test.rb +18 -0
- data/test/test_app/test/functional/fast_controller_test.rb +18 -0
- data/test/test_app/test/functional/slow_controller_test.rb +18 -0
- data/test/test_app/test/functional/very_slow_controller_test.rb +18 -0
- data/test/test_app/test/test_helper.rb +28 -0
- metadata +263 -0
@@ -0,0 +1,91 @@
|
|
1
|
+
#!/bin/sh -e
|
2
|
+
|
3
|
+
# This file is part of EC2 on Rails.
|
4
|
+
# http://rubyforge.org/projects/ec2onrails/
|
5
|
+
#
|
6
|
+
# Copyright 2007 Paul Dowman, http://pauldowman.com/
|
7
|
+
#
|
8
|
+
# EC2 on Rails is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation; either version 2 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# EC2 on Rails is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# This is the init script to start/stop mongrel
|
24
|
+
#
|
25
|
+
|
26
|
+
NAME="mongrel cluster"
|
27
|
+
NO_START=0
|
28
|
+
|
29
|
+
########################################
|
30
|
+
|
31
|
+
if [ ! -d /mnt/app/current ] ; then
|
32
|
+
echo "/mnt/app/current doesn't exist, not starting mongrel..."
|
33
|
+
exit 0
|
34
|
+
fi
|
35
|
+
|
36
|
+
start_cmd() {
|
37
|
+
/usr/local/ec2onrails/bin/mongrel_start
|
38
|
+
return $?
|
39
|
+
}
|
40
|
+
|
41
|
+
stop_cmd() {
|
42
|
+
/usr/local/ec2onrails/bin/mongrel_stop
|
43
|
+
return $?
|
44
|
+
}
|
45
|
+
|
46
|
+
restart_cmd() {
|
47
|
+
/usr/local/ec2onrails/bin/mongrel_stop && /usr/local/ec2onrails/bin/mongrel_start
|
48
|
+
return $?
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
########################################
|
53
|
+
|
54
|
+
. /lib/lsb/init-functions
|
55
|
+
|
56
|
+
test -f /etc/default/rcS && . /etc/default/rcS
|
57
|
+
|
58
|
+
if [ "$NO_START" != "0" -a "$1" != "stop" ]; then
|
59
|
+
[ "$VERBOSE" != no ] && log_warning_msg "Not starting $NAME - edit $0 and change NO_START to be 0.";
|
60
|
+
exit 0;
|
61
|
+
fi
|
62
|
+
|
63
|
+
case "$1" in
|
64
|
+
start)
|
65
|
+
log_begin_msg "Starting $NAME..."
|
66
|
+
if start_cmd; then
|
67
|
+
log_end_msg 0
|
68
|
+
else
|
69
|
+
log_end_msg 1
|
70
|
+
fi
|
71
|
+
;;
|
72
|
+
stop)
|
73
|
+
log_begin_msg "Stopping $NAME..."
|
74
|
+
if stop_cmd; then
|
75
|
+
log_end_msg 0
|
76
|
+
else
|
77
|
+
log_end_msg 1
|
78
|
+
fi
|
79
|
+
;;
|
80
|
+
restart)
|
81
|
+
log_begin_msg "Restarting $NAME..."
|
82
|
+
if restart_cmd; then
|
83
|
+
log_end_msg 0
|
84
|
+
else
|
85
|
+
log_end_msg 1
|
86
|
+
fi
|
87
|
+
;;
|
88
|
+
*)
|
89
|
+
log_success_msg "Usage: $0 {start|stop|restart}"
|
90
|
+
;;
|
91
|
+
esac
|
@@ -0,0 +1,91 @@
|
|
1
|
+
#!/bin/sh -e
|
2
|
+
|
3
|
+
# This file is part of EC2 on Rails.
|
4
|
+
# http://rubyforge.org/projects/ec2onrails/
|
5
|
+
#
|
6
|
+
# Copyright 2007 Paul Dowman, http://pauldowman.com/
|
7
|
+
#
|
8
|
+
# EC2 on Rails is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation; either version 2 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# EC2 on Rails is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# This is the init script to start/stop mongrel
|
24
|
+
#
|
25
|
+
|
26
|
+
NAME="mongrel cluster"
|
27
|
+
NO_START=0
|
28
|
+
|
29
|
+
########################################
|
30
|
+
|
31
|
+
if [ ! -d /mnt/app/current ] ; then
|
32
|
+
echo "/mnt/app/current doesn't exist, not starting mongrel..."
|
33
|
+
exit 0
|
34
|
+
fi
|
35
|
+
|
36
|
+
start_cmd() {
|
37
|
+
/usr/local/ec2onrails/bin/mongrel_start
|
38
|
+
return $?
|
39
|
+
}
|
40
|
+
|
41
|
+
stop_cmd() {
|
42
|
+
/usr/local/ec2onrails/bin/mongrel_stop
|
43
|
+
return $?
|
44
|
+
}
|
45
|
+
|
46
|
+
restart_cmd() {
|
47
|
+
/usr/local/ec2onrails/bin/mongrel_stop && /usr/local/ec2onrails/bin/mongrel_start
|
48
|
+
return $?
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
########################################
|
53
|
+
|
54
|
+
. /lib/lsb/init-functions
|
55
|
+
|
56
|
+
test -f /etc/default/rcS && . /etc/default/rcS
|
57
|
+
|
58
|
+
if [ "$NO_START" != "0" -a "$1" != "stop" ]; then
|
59
|
+
[ "$VERBOSE" != no ] && log_warning_msg "Not starting $NAME - edit $0 and change NO_START to be 0.";
|
60
|
+
exit 0;
|
61
|
+
fi
|
62
|
+
|
63
|
+
case "$1" in
|
64
|
+
start)
|
65
|
+
log_begin_msg "Starting $NAME..."
|
66
|
+
if start_cmd; then
|
67
|
+
log_end_msg 0
|
68
|
+
else
|
69
|
+
log_end_msg 1
|
70
|
+
fi
|
71
|
+
;;
|
72
|
+
stop)
|
73
|
+
log_begin_msg "Stopping $NAME..."
|
74
|
+
if stop_cmd; then
|
75
|
+
log_end_msg 0
|
76
|
+
else
|
77
|
+
log_end_msg 1
|
78
|
+
fi
|
79
|
+
;;
|
80
|
+
restart)
|
81
|
+
log_begin_msg "Restarting $NAME..."
|
82
|
+
if restart_cmd; then
|
83
|
+
log_end_msg 0
|
84
|
+
else
|
85
|
+
log_end_msg 1
|
86
|
+
fi
|
87
|
+
;;
|
88
|
+
*)
|
89
|
+
log_success_msg "Usage: $0 {start|stop|restart}"
|
90
|
+
;;
|
91
|
+
esac
|
@@ -0,0 +1,91 @@
|
|
1
|
+
#!/bin/sh -e
|
2
|
+
|
3
|
+
# This file is part of EC2 on Rails.
|
4
|
+
# http://rubyforge.org/projects/ec2onrails/
|
5
|
+
#
|
6
|
+
# Copyright 2007 Paul Dowman, http://pauldowman.com/
|
7
|
+
#
|
8
|
+
# EC2 on Rails is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation; either version 2 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# EC2 on Rails is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# This is the init script to start/stop mongrel
|
24
|
+
#
|
25
|
+
|
26
|
+
NAME="mongrel cluster"
|
27
|
+
NO_START=0
|
28
|
+
|
29
|
+
########################################
|
30
|
+
|
31
|
+
if [ ! -d /mnt/app/current ] ; then
|
32
|
+
echo "/mnt/app/current doesn't exist, not starting mongrel..."
|
33
|
+
exit 0
|
34
|
+
fi
|
35
|
+
|
36
|
+
start_cmd() {
|
37
|
+
/usr/local/ec2onrails/bin/mongrel_start
|
38
|
+
return $?
|
39
|
+
}
|
40
|
+
|
41
|
+
stop_cmd() {
|
42
|
+
/usr/local/ec2onrails/bin/mongrel_stop
|
43
|
+
return $?
|
44
|
+
}
|
45
|
+
|
46
|
+
restart_cmd() {
|
47
|
+
/usr/local/ec2onrails/bin/mongrel_stop && /usr/local/ec2onrails/bin/mongrel_start
|
48
|
+
return $?
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
########################################
|
53
|
+
|
54
|
+
. /lib/lsb/init-functions
|
55
|
+
|
56
|
+
test -f /etc/default/rcS && . /etc/default/rcS
|
57
|
+
|
58
|
+
if [ "$NO_START" != "0" -a "$1" != "stop" ]; then
|
59
|
+
[ "$VERBOSE" != no ] && log_warning_msg "Not starting $NAME - edit $0 and change NO_START to be 0.";
|
60
|
+
exit 0;
|
61
|
+
fi
|
62
|
+
|
63
|
+
case "$1" in
|
64
|
+
start)
|
65
|
+
log_begin_msg "Starting $NAME..."
|
66
|
+
if start_cmd; then
|
67
|
+
log_end_msg 0
|
68
|
+
else
|
69
|
+
log_end_msg 1
|
70
|
+
fi
|
71
|
+
;;
|
72
|
+
stop)
|
73
|
+
log_begin_msg "Stopping $NAME..."
|
74
|
+
if stop_cmd; then
|
75
|
+
log_end_msg 0
|
76
|
+
else
|
77
|
+
log_end_msg 1
|
78
|
+
fi
|
79
|
+
;;
|
80
|
+
restart)
|
81
|
+
log_begin_msg "Restarting $NAME..."
|
82
|
+
if restart_cmd; then
|
83
|
+
log_end_msg 0
|
84
|
+
else
|
85
|
+
log_end_msg 1
|
86
|
+
fi
|
87
|
+
;;
|
88
|
+
*)
|
89
|
+
log_success_msg "Usage: $0 {start|stop|restart}"
|
90
|
+
;;
|
91
|
+
esac
|
@@ -0,0 +1,91 @@
|
|
1
|
+
#!/bin/sh -e
|
2
|
+
|
3
|
+
# This file is part of EC2 on Rails.
|
4
|
+
# http://rubyforge.org/projects/ec2onrails/
|
5
|
+
#
|
6
|
+
# Copyright 2007 Paul Dowman, http://pauldowman.com/
|
7
|
+
#
|
8
|
+
# EC2 on Rails is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation; either version 2 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# EC2 on Rails is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# This is the init script to start/stop mongrel
|
24
|
+
#
|
25
|
+
|
26
|
+
NAME="mongrel cluster"
|
27
|
+
NO_START=0
|
28
|
+
|
29
|
+
########################################
|
30
|
+
|
31
|
+
if [ ! -d /mnt/app/current ] ; then
|
32
|
+
echo "/mnt/app/current doesn't exist, not starting mongrel..."
|
33
|
+
exit 0
|
34
|
+
fi
|
35
|
+
|
36
|
+
start_cmd() {
|
37
|
+
/usr/local/ec2onrails/bin/mongrel_start
|
38
|
+
return $?
|
39
|
+
}
|
40
|
+
|
41
|
+
stop_cmd() {
|
42
|
+
/usr/local/ec2onrails/bin/mongrel_stop
|
43
|
+
return $?
|
44
|
+
}
|
45
|
+
|
46
|
+
restart_cmd() {
|
47
|
+
/usr/local/ec2onrails/bin/mongrel_stop && /usr/local/ec2onrails/bin/mongrel_start
|
48
|
+
return $?
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
########################################
|
53
|
+
|
54
|
+
. /lib/lsb/init-functions
|
55
|
+
|
56
|
+
test -f /etc/default/rcS && . /etc/default/rcS
|
57
|
+
|
58
|
+
if [ "$NO_START" != "0" -a "$1" != "stop" ]; then
|
59
|
+
[ "$VERBOSE" != no ] && log_warning_msg "Not starting $NAME - edit $0 and change NO_START to be 0.";
|
60
|
+
exit 0;
|
61
|
+
fi
|
62
|
+
|
63
|
+
case "$1" in
|
64
|
+
start)
|
65
|
+
log_begin_msg "Starting $NAME..."
|
66
|
+
if start_cmd; then
|
67
|
+
log_end_msg 0
|
68
|
+
else
|
69
|
+
log_end_msg 1
|
70
|
+
fi
|
71
|
+
;;
|
72
|
+
stop)
|
73
|
+
log_begin_msg "Stopping $NAME..."
|
74
|
+
if stop_cmd; then
|
75
|
+
log_end_msg 0
|
76
|
+
else
|
77
|
+
log_end_msg 1
|
78
|
+
fi
|
79
|
+
;;
|
80
|
+
restart)
|
81
|
+
log_begin_msg "Restarting $NAME..."
|
82
|
+
if restart_cmd; then
|
83
|
+
log_end_msg 0
|
84
|
+
else
|
85
|
+
log_end_msg 1
|
86
|
+
fi
|
87
|
+
;;
|
88
|
+
*)
|
89
|
+
log_success_msg "Usage: $0 {start|stop|restart}"
|
90
|
+
;;
|
91
|
+
esac
|
@@ -0,0 +1,91 @@
|
|
1
|
+
#!/bin/sh -e
|
2
|
+
|
3
|
+
# This file is part of EC2 on Rails.
|
4
|
+
# http://rubyforge.org/projects/ec2onrails/
|
5
|
+
#
|
6
|
+
# Copyright 2007 Paul Dowman, http://pauldowman.com/
|
7
|
+
#
|
8
|
+
# EC2 on Rails is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation; either version 2 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# EC2 on Rails is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# This is the init script to start/stop mongrel
|
24
|
+
#
|
25
|
+
|
26
|
+
NAME="mongrel cluster"
|
27
|
+
NO_START=0
|
28
|
+
|
29
|
+
########################################
|
30
|
+
|
31
|
+
if [ ! -d /mnt/app/current ] ; then
|
32
|
+
echo "/mnt/app/current doesn't exist, not starting mongrel..."
|
33
|
+
exit 0
|
34
|
+
fi
|
35
|
+
|
36
|
+
start_cmd() {
|
37
|
+
/usr/local/ec2onrails/bin/mongrel_start
|
38
|
+
return $?
|
39
|
+
}
|
40
|
+
|
41
|
+
stop_cmd() {
|
42
|
+
/usr/local/ec2onrails/bin/mongrel_stop
|
43
|
+
return $?
|
44
|
+
}
|
45
|
+
|
46
|
+
restart_cmd() {
|
47
|
+
/usr/local/ec2onrails/bin/mongrel_stop && /usr/local/ec2onrails/bin/mongrel_start
|
48
|
+
return $?
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
########################################
|
53
|
+
|
54
|
+
. /lib/lsb/init-functions
|
55
|
+
|
56
|
+
test -f /etc/default/rcS && . /etc/default/rcS
|
57
|
+
|
58
|
+
if [ "$NO_START" != "0" -a "$1" != "stop" ]; then
|
59
|
+
[ "$VERBOSE" != no ] && log_warning_msg "Not starting $NAME - edit $0 and change NO_START to be 0.";
|
60
|
+
exit 0;
|
61
|
+
fi
|
62
|
+
|
63
|
+
case "$1" in
|
64
|
+
start)
|
65
|
+
log_begin_msg "Starting $NAME..."
|
66
|
+
if start_cmd; then
|
67
|
+
log_end_msg 0
|
68
|
+
else
|
69
|
+
log_end_msg 1
|
70
|
+
fi
|
71
|
+
;;
|
72
|
+
stop)
|
73
|
+
log_begin_msg "Stopping $NAME..."
|
74
|
+
if stop_cmd; then
|
75
|
+
log_end_msg 0
|
76
|
+
else
|
77
|
+
log_end_msg 1
|
78
|
+
fi
|
79
|
+
;;
|
80
|
+
restart)
|
81
|
+
log_begin_msg "Restarting $NAME..."
|
82
|
+
if restart_cmd; then
|
83
|
+
log_end_msg 0
|
84
|
+
else
|
85
|
+
log_end_msg 1
|
86
|
+
fi
|
87
|
+
;;
|
88
|
+
*)
|
89
|
+
log_success_msg "Usage: $0 {start|stop|restart}"
|
90
|
+
;;
|
91
|
+
esac
|
@@ -0,0 +1,91 @@
|
|
1
|
+
#!/bin/sh -e
|
2
|
+
|
3
|
+
# This file is part of EC2 on Rails.
|
4
|
+
# http://rubyforge.org/projects/ec2onrails/
|
5
|
+
#
|
6
|
+
# Copyright 2007 Paul Dowman, http://pauldowman.com/
|
7
|
+
#
|
8
|
+
# EC2 on Rails is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation; either version 2 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# EC2 on Rails is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# This is the init script to start/stop mongrel
|
24
|
+
#
|
25
|
+
|
26
|
+
NAME="mongrel cluster"
|
27
|
+
NO_START=0
|
28
|
+
|
29
|
+
########################################
|
30
|
+
|
31
|
+
if [ ! -d /mnt/app/current ] ; then
|
32
|
+
echo "/mnt/app/current doesn't exist, not starting mongrel..."
|
33
|
+
exit 0
|
34
|
+
fi
|
35
|
+
|
36
|
+
start_cmd() {
|
37
|
+
/usr/local/ec2onrails/bin/mongrel_start
|
38
|
+
return $?
|
39
|
+
}
|
40
|
+
|
41
|
+
stop_cmd() {
|
42
|
+
/usr/local/ec2onrails/bin/mongrel_stop
|
43
|
+
return $?
|
44
|
+
}
|
45
|
+
|
46
|
+
restart_cmd() {
|
47
|
+
/usr/local/ec2onrails/bin/mongrel_stop && /usr/local/ec2onrails/bin/mongrel_start
|
48
|
+
return $?
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
########################################
|
53
|
+
|
54
|
+
. /lib/lsb/init-functions
|
55
|
+
|
56
|
+
test -f /etc/default/rcS && . /etc/default/rcS
|
57
|
+
|
58
|
+
if [ "$NO_START" != "0" -a "$1" != "stop" ]; then
|
59
|
+
[ "$VERBOSE" != no ] && log_warning_msg "Not starting $NAME - edit $0 and change NO_START to be 0.";
|
60
|
+
exit 0;
|
61
|
+
fi
|
62
|
+
|
63
|
+
case "$1" in
|
64
|
+
start)
|
65
|
+
log_begin_msg "Starting $NAME..."
|
66
|
+
if start_cmd; then
|
67
|
+
log_end_msg 0
|
68
|
+
else
|
69
|
+
log_end_msg 1
|
70
|
+
fi
|
71
|
+
;;
|
72
|
+
stop)
|
73
|
+
log_begin_msg "Stopping $NAME..."
|
74
|
+
if stop_cmd; then
|
75
|
+
log_end_msg 0
|
76
|
+
else
|
77
|
+
log_end_msg 1
|
78
|
+
fi
|
79
|
+
;;
|
80
|
+
restart)
|
81
|
+
log_begin_msg "Restarting $NAME..."
|
82
|
+
if restart_cmd; then
|
83
|
+
log_end_msg 0
|
84
|
+
else
|
85
|
+
log_end_msg 1
|
86
|
+
fi
|
87
|
+
;;
|
88
|
+
*)
|
89
|
+
log_success_msg "Usage: $0 {start|stop|restart}"
|
90
|
+
;;
|
91
|
+
esac
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
# This file is part of EC2 on Rails.
|
4
|
+
# http://rubyforge.org/projects/ec2onrails/
|
5
|
+
#
|
6
|
+
# Copyright 2007 Paul Dowman, http://pauldowman.com/
|
7
|
+
#
|
8
|
+
# EC2 on Rails is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation; either version 2 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# EC2 on Rails is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
|
21
|
+
|
22
|
+
# This script runs the ec2 startup scripts
|
23
|
+
|
24
|
+
FILE=/ec2onrails-first-boot
|
25
|
+
|
26
|
+
if [ -e $FILE ] ; then
|
27
|
+
|
28
|
+
# this is an ugly hack to make sure DHCP initialization is finished:
|
29
|
+
sleep 15
|
30
|
+
|
31
|
+
for SCRIPT in `ls -I README /usr/local/ec2onrails/startup-scripts/first-startup` ; do
|
32
|
+
"/usr/local/ec2onrails/startup-scripts/first-startup/$SCRIPT"
|
33
|
+
done
|
34
|
+
|
35
|
+
rm $FILE
|
36
|
+
fi
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
# This file is part of EC2 on Rails.
|
4
|
+
# http://rubyforge.org/projects/ec2onrails/
|
5
|
+
#
|
6
|
+
# Copyright 2007 Paul Dowman, http://pauldowman.com/
|
7
|
+
#
|
8
|
+
# EC2 on Rails is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation; either version 2 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# EC2 on Rails is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
|
21
|
+
|
22
|
+
# This script runs the ec2 startup scripts
|
23
|
+
|
24
|
+
# this is an ugly hack to make sure DHCP initialization is finished:
|
25
|
+
sleep 15
|
26
|
+
|
27
|
+
for SCRIPT in `ls -I README /usr/local/ec2onrails/startup-scripts/every-startup` ; do
|
28
|
+
"/usr/local/ec2onrails/startup-scripts/every-startup/$SCRIPT"
|
29
|
+
done
|