le1t0-deprec 2.1.6.001
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +444 -0
- data/COPYING +19 -0
- data/LICENSE +339 -0
- data/README +154 -0
- data/THANKS +17 -0
- data/bin/depify +139 -0
- data/docs/EXAMPLE-installing_tracks.txt +41 -0
- data/docs/README.nagios +22 -0
- data/docs/README.rails +17 -0
- data/docs/config_gen_explained.txt +39 -0
- data/docs/deprec-1.x/deprec-1.x.quickstart +50 -0
- data/docs/deprec-1.x/notes.txt +12 -0
- data/docs/old/deprec_banner.gif +0 -0
- data/docs/windows_linux.txt +350 -0
- data/docs/xen/traffic_monitoring_with_vnstat.txt +95 -0
- data/docs/xen/xen-tools-notes.txt +31 -0
- data/docs/xen/xen_on_hardy.txt +39 -0
- data/lib/deprec.rb +42 -0
- data/lib/deprec/capistrano_extensions.rb +446 -0
- data/lib/deprec/recipes.rb +7 -0
- data/lib/deprec/recipes/aoe.rb +79 -0
- data/lib/deprec/recipes/app/mongrel.rb +213 -0
- data/lib/deprec/recipes/app/passenger.rb +190 -0
- data/lib/deprec/recipes/ar_sendmail.rb +67 -0
- data/lib/deprec/recipes/aspell.rb +22 -0
- data/lib/deprec/recipes/canonical.rb +68 -0
- data/lib/deprec/recipes/cap.rb +39 -0
- data/lib/deprec/recipes/chef.rb +68 -0
- data/lib/deprec/recipes/collectd.rb +112 -0
- data/lib/deprec/recipes/db/couchdb.rb +107 -0
- data/lib/deprec/recipes/db/mysql.rb +194 -0
- data/lib/deprec/recipes/db/postgresql.rb +104 -0
- data/lib/deprec/recipes/db/sqlite.rb +37 -0
- data/lib/deprec/recipes/ddclient.rb +51 -0
- data/lib/deprec/recipes/deprec.rb +167 -0
- data/lib/deprec/recipes/deprecated.rb +71 -0
- data/lib/deprec/recipes/drbd.rb +137 -0
- data/lib/deprec/recipes/dummy.rb +22 -0
- data/lib/deprec/recipes/example.rb +115 -0
- data/lib/deprec/recipes/git.rb +97 -0
- data/lib/deprec/recipes/gitosis.rb.disabled +55 -0
- data/lib/deprec/recipes/glusterfs.rb +176 -0
- data/lib/deprec/recipes/god.rb +70 -0
- data/lib/deprec/recipes/haproxy.rb +115 -0
- data/lib/deprec/recipes/heartbeat.rb +138 -0
- data/lib/deprec/recipes/imagemagick/imagemagick_bin.rb +24 -0
- data/lib/deprec/recipes/imagemagick/imagemagick_src.rb +39 -0
- data/lib/deprec/recipes/integrity.rb +108 -0
- data/lib/deprec/recipes/iptables.rb +94 -0
- data/lib/deprec/recipes/java.rb +23 -0
- data/lib/deprec/recipes/keepalived.rb +78 -0
- data/lib/deprec/recipes/ldap.rb +52 -0
- data/lib/deprec/recipes/logrotate.rb +56 -0
- data/lib/deprec/recipes/lvm.rb +20 -0
- data/lib/deprec/recipes/memcache.rb +49 -0
- data/lib/deprec/recipes/mongodb.rb +94 -0
- data/lib/deprec/recipes/monit.rb +135 -0
- data/lib/deprec/recipes/mysql_proxy.rb +67 -0
- data/lib/deprec/recipes/nagios.rb +361 -0
- data/lib/deprec/recipes/network.rb +116 -0
- data/lib/deprec/recipes/ntp.rb +103 -0
- data/lib/deprec/recipes/php.rb +58 -0
- data/lib/deprec/recipes/postfix.rb +115 -0
- data/lib/deprec/recipes/profiles.rb +125 -0
- data/lib/deprec/recipes/raid/amcc_3ware.rb +21 -0
- data/lib/deprec/recipes/rails.rb +330 -0
- data/lib/deprec/recipes/redhat_cluster.rb +228 -0
- data/lib/deprec/recipes/redis.rb +90 -0
- data/lib/deprec/recipes/ruby/mri.rb +55 -0
- data/lib/deprec/recipes/ruby/ree.rb +40 -0
- data/lib/deprec/recipes/rvm.rb +32 -0
- data/lib/deprec/recipes/s3utils.rb +63 -0
- data/lib/deprec/recipes/sphinx/thinking_sphinx.rb +105 -0
- data/lib/deprec/recipes/sphinx/ultrasphinx.rb +86 -0
- data/lib/deprec/recipes/ssh.rb +147 -0
- data/lib/deprec/recipes/ssl.rb +56 -0
- data/lib/deprec/recipes/starling.rb +119 -0
- data/lib/deprec/recipes/svn.rb +171 -0
- data/lib/deprec/recipes/syslog.rb +63 -0
- data/lib/deprec/recipes/trac.rb.disabled +277 -0
- data/lib/deprec/recipes/tsung.rb +74 -0
- data/lib/deprec/recipes/ubuntu.rb +90 -0
- data/lib/deprec/recipes/users.rb +90 -0
- data/lib/deprec/recipes/utils.rb +58 -0
- data/lib/deprec/recipes/vnstat.rb +85 -0
- data/lib/deprec/recipes/web/apache.rb +143 -0
- data/lib/deprec/recipes/web/nginx.rb +172 -0
- data/lib/deprec/recipes/wordpress.rb.notworking +96 -0
- data/lib/deprec/recipes/wpmu.rb +103 -0
- data/lib/deprec/recipes/xen.rb +364 -0
- data/lib/deprec/recipes/xentools.rb +101 -0
- data/lib/deprec/recipes_minus_rails.rb +125 -0
- data/lib/deprec/templates/aoe/aoe-init +55 -0
- data/lib/deprec/templates/aoe/fence_aoemask +351 -0
- data/lib/deprec/templates/apache/namevirtualhosts.conf +5 -0
- data/lib/deprec/templates/apache/ports.conf.erb +5 -0
- data/lib/deprec/templates/apache/status.conf.erb +17 -0
- data/lib/deprec/templates/ar_sendmail/logrotate.conf.erb +9 -0
- data/lib/deprec/templates/ar_sendmail/monit.conf.erb +5 -0
- data/lib/deprec/templates/chef/chef.json.erb +1 -0
- data/lib/deprec/templates/chef/solo.rb +2 -0
- data/lib/deprec/templates/collectd/collectd-init.d +153 -0
- data/lib/deprec/templates/collectd/collectd.conf.erb +686 -0
- data/lib/deprec/templates/ddclient/ddclient.conf.erb +11 -0
- data/lib/deprec/templates/ddclient/ddclient.erb +15 -0
- data/lib/deprec/templates/deprec/caprc.erb +14 -0
- data/lib/deprec/templates/drbd/drbd.conf.erb +531 -0
- data/lib/deprec/templates/glusterfs/glusterfsd-init.erb +95 -0
- data/lib/deprec/templates/gnbd_client/cluster.conf.erb +21 -0
- data/lib/deprec/templates/gnbd_client/clvm-default.erb +3 -0
- data/lib/deprec/templates/gnbd_client/cman-default.erb +6 -0
- data/lib/deprec/templates/gnbd_client/gnbdimports.conf.erb +1 -0
- data/lib/deprec/templates/gnbd_server/cluster.conf.erb +20 -0
- data/lib/deprec/templates/gnbd_server/clvm-default.erb +3 -0
- data/lib/deprec/templates/gnbd_server/cman-default.erb +6 -0
- data/lib/deprec/templates/gnbd_server/gnbd-server-default.erb +1 -0
- data/lib/deprec/templates/gnbd_server/gnbdexports.conf.erb +1 -0
- data/lib/deprec/templates/god/god-conf.erb +2 -0
- data/lib/deprec/templates/god/god-init.erb +47 -0
- data/lib/deprec/templates/haproxy/haproxy-init.d +120 -0
- data/lib/deprec/templates/haproxy/haproxy.cfg.erb +31 -0
- data/lib/deprec/templates/heartbeat/authkeys.erb +2 -0
- data/lib/deprec/templates/heartbeat/ha.cf.erb +15 -0
- data/lib/deprec/templates/heartbeat/haresources.erb +1 -0
- data/lib/deprec/templates/integrity/apache_vhost.erb +4 -0
- data/lib/deprec/templates/integrity/config.ru.erb +21 -0
- data/lib/deprec/templates/integrity/config.yml.erb +43 -0
- data/lib/deprec/templates/iptables/firewall-default.erb +13 -0
- data/lib/deprec/templates/iptables/firewall-init.erb +171 -0
- data/lib/deprec/templates/keepalived/keepalived.conf.erb +18 -0
- data/lib/deprec/templates/logrotate/logrotate.conf.erb +32 -0
- data/lib/deprec/templates/mongodb/mongodb-init.d +88 -0
- data/lib/deprec/templates/mongrel/apache_vhost.conf.erb +148 -0
- data/lib/deprec/templates/mongrel/logrotate.conf.erb +11 -0
- data/lib/deprec/templates/mongrel/mongrel_cluster-init-script +54 -0
- data/lib/deprec/templates/mongrel/mongrel_cluster.yml.erb +10 -0
- data/lib/deprec/templates/mongrel/monit.conf.erb +17 -0
- data/lib/deprec/templates/mongrel/nginx_vhost.conf.erb +41 -0
- data/lib/deprec/templates/monit/monit-init-script +104 -0
- data/lib/deprec/templates/monit/monitrc.erb +250 -0
- data/lib/deprec/templates/monit/nothing.monitrc +0 -0
- data/lib/deprec/templates/mysql/create_databases.sql +20 -0
- data/lib/deprec/templates/mysql/database.yml.prod +6 -0
- data/lib/deprec/templates/mysql/database.yml.stage +6 -0
- data/lib/deprec/templates/mysql/my.cnf.erb +140 -0
- data/lib/deprec/templates/mysql/sphinx.conf.prod +542 -0
- data/lib/deprec/templates/mysql/sphinx.conf.stage +542 -0
- data/lib/deprec/templates/mysql_proxy/mysql-proxy-default.erb +4 -0
- data/lib/deprec/templates/nagios/README +32 -0
- data/lib/deprec/templates/nagios/cgi.cfg.erb +357 -0
- data/lib/deprec/templates/nagios/check_linux_free_memory.pl +118 -0
- data/lib/deprec/templates/nagios/check_mongrel_cluster.rb +82 -0
- data/lib/deprec/templates/nagios/htpasswd.users +1 -0
- data/lib/deprec/templates/nagios/mrtg.cfg +180 -0
- data/lib/deprec/templates/nagios/nagios.cfg.erb +1325 -0
- data/lib/deprec/templates/nagios/nrpe.cfg.erb +222 -0
- data/lib/deprec/templates/nagios/nrpe.xinetd.erb +16 -0
- data/lib/deprec/templates/nagios/objects/commands.cfg.erb +265 -0
- data/lib/deprec/templates/nagios/objects/contacts.cfg.erb +89 -0
- data/lib/deprec/templates/nagios/objects/hosts.cfg.erb +114 -0
- data/lib/deprec/templates/nagios/objects/localhost.cfg.erb +116 -0
- data/lib/deprec/templates/nagios/objects/services.cfg.erb +165 -0
- data/lib/deprec/templates/nagios/objects/timeperiods.cfg.erb +94 -0
- data/lib/deprec/templates/nagios/resource.cfg.erb +34 -0
- data/lib/deprec/templates/network/hostname.erb +1 -0
- data/lib/deprec/templates/network/hosts.erb +2 -0
- data/lib/deprec/templates/network/interfaces.erb +18 -0
- data/lib/deprec/templates/network/resolv.conf.erb +6 -0
- data/lib/deprec/templates/nginx/logrotate.conf.erb +13 -0
- data/lib/deprec/templates/nginx/mime.types.erb +70 -0
- data/lib/deprec/templates/nginx/nginx-init-script +62 -0
- data/lib/deprec/templates/nginx/nginx.conf.erb +125 -0
- data/lib/deprec/templates/nginx/nginx.logrotate.d +12 -0
- data/lib/deprec/templates/nginx/nothing.conf +1 -0
- data/lib/deprec/templates/nginx/rails_nginx_vhost.conf.erb +41 -0
- data/lib/deprec/templates/ntp/ntp.conf.erb +42 -0
- data/lib/deprec/templates/passenger/apache_vhost.erb +29 -0
- data/lib/deprec/templates/passenger/logrotate.conf.erb +12 -0
- data/lib/deprec/templates/passenger/passenger.conf.erb +21 -0
- data/lib/deprec/templates/passenger/passenger.load.erb +3 -0
- data/lib/deprec/templates/postfix/aliases.erb +3 -0
- data/lib/deprec/templates/postfix/dynamicmaps.cf.erb +8 -0
- data/lib/deprec/templates/postfix/main.cf.erb +36 -0
- data/lib/deprec/templates/postfix/master.cf.erb +77 -0
- data/lib/deprec/templates/redis/redis-conf.erb +132 -0
- data/lib/deprec/templates/redis/redis-init.erb +50 -0
- data/lib/deprec/templates/s3utils/s3cfg +35 -0
- data/lib/deprec/templates/s3utils/s3config.yml +3 -0
- data/lib/deprec/templates/sphinx/monit.conf.erb +5 -0
- data/lib/deprec/templates/ssh/ssh_config.erb +50 -0
- data/lib/deprec/templates/ssh/sshd_config.erb +78 -0
- data/lib/deprec/templates/ssl/make-ssl-cert +138 -0
- data/lib/deprec/templates/ssl/ssl-cert-snakeoil.key +15 -0
- data/lib/deprec/templates/ssl/ssl-cert-snakeoil.pem +19 -0
- data/lib/deprec/templates/starling/monit.conf.erb +14 -0
- data/lib/deprec/templates/starling/starling-init-script.erb +71 -0
- data/lib/deprec/templates/subversion/svn.apache.vhost.erb +43 -0
- data/lib/deprec/templates/syslog/syslog.conf.erb +71 -0
- data/lib/deprec/templates/syslog/syslogd.erb +13 -0
- data/lib/deprec/templates/trac/apache_vhost.conf.erb +24 -0
- data/lib/deprec/templates/trac/nginx_vhost.conf.erb +26 -0
- data/lib/deprec/templates/trac/trac.ini.erb +169 -0
- data/lib/deprec/templates/trac/trac_deprec.png +0 -0
- data/lib/deprec/templates/trac/tracd-init.erb +43 -0
- data/lib/deprec/templates/trac/users.htdigest.erb +0 -0
- data/lib/deprec/templates/tsung/tsung.xml.erb +47 -0
- data/lib/deprec/templates/vnstat/config.php +57 -0
- data/lib/deprec/templates/wordpress/apache2_wordpress_vhost.conf.erb +31 -0
- data/lib/deprec/templates/wordpress/wp-config.php.erb +31 -0
- data/lib/deprec/templates/wpmu/apache_vhost.conf.erb +13 -0
- data/lib/deprec/templates/xen/network-bridge-wrapper +3 -0
- data/lib/deprec/templates/xen/xend-config.sxp.erb +195 -0
- data/lib/deprec/templates/xen/xend-init.erb +57 -0
- data/lib/deprec/templates/xen/xendomains.erb +137 -0
- data/lib/deprec/templates/xentools/100-ubuntu-setup +26 -0
- data/lib/deprec/templates/xentools/15-disable-hwclock +40 -0
- data/lib/deprec/templates/xentools/30-disable-gettys +57 -0
- data/lib/deprec/templates/xentools/31-ubuntu-setup +32 -0
- data/lib/deprec/templates/xentools/40-setup-networking +145 -0
- data/lib/deprec/templates/xentools/98-custom +17 -0
- data/lib/deprec/templates/xentools/xen-tools.conf.erb +278 -0
- data/lib/deprec/templates/xentools/xm.tmpl.erb +138 -0
- data/lib/deprec_cmd_completion.sh +26 -0
- data/lib/deprec_minus_rails.rb +12 -0
- data/lib/vmbuilder_plugins/all.rb +20 -0
- data/lib/vmbuilder_plugins/apt.rb +93 -0
- data/lib/vmbuilder_plugins/emerge.rb +76 -0
- data/lib/vmbuilder_plugins/gem.rb +100 -0
- data/lib/vmbuilder_plugins/std.rb +203 -0
- metadata +304 -0
@@ -0,0 +1,95 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# Author: Chris AtLee <chris@atlee.ca>
|
4
|
+
# Patched by: Matthias Albert < matthias@linux4experts.de>
|
5
|
+
# Patched by: le1t0@github <dev@ewout.to> (rewrite for supporting multiple configs/daemons)
|
6
|
+
|
7
|
+
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
8
|
+
NAME=glusterfsd
|
9
|
+
SCRIPTNAME=/etc/init.d/$NAME
|
10
|
+
DAEMON=/usr/sbin/$NAME
|
11
|
+
|
12
|
+
function configs () {
|
13
|
+
find /etc/glusterfs -name "*-export.vol" | while read e ; do echo "$(basename "${e}" -export.vol | perl -p -e 's/^([0-9]{1,3}\.){3}[0-9]{1,3}-//'),${e}" ; done
|
14
|
+
}
|
15
|
+
|
16
|
+
# Gracefully exit if the package has been removed.
|
17
|
+
test -x $DAEMON || exit 0
|
18
|
+
|
19
|
+
# Load the VERBOSE setting and other rcS variables
|
20
|
+
. /lib/init/vars.sh
|
21
|
+
|
22
|
+
# Define LSB log_* functions.
|
23
|
+
. /lib/lsb/init-functions
|
24
|
+
|
25
|
+
function do_start() {
|
26
|
+
configs | while read c ; do {
|
27
|
+
n="$(echo $c | awk -F "," '{ print $1; }')"
|
28
|
+
pidfile=/var/run/${NAME}_${n}.pid
|
29
|
+
configfile="$(echo $c | awk -F "," '{ print $2; }')"
|
30
|
+
glusterfs_opts="-f $configfile"
|
31
|
+
|
32
|
+
pidofproc -p $pidfile $DAEMON >/dev/null
|
33
|
+
status=$?
|
34
|
+
if [ $status -eq 0 ]; then
|
35
|
+
log_success_msg "glusterfs server for ${n} is already running with pid $(test -f $pidfile && cat $pidfile)"
|
36
|
+
else
|
37
|
+
log_daemon_msg "Starting glusterfs server for ${n}" "glusterfsd"
|
38
|
+
start-stop-daemon --start --quiet --oknodo --pidfile $pidfile --startas $DAEMON -- -p $pidfile $glusterfs_opts
|
39
|
+
log_end_msg $?
|
40
|
+
start_daemon -p $pidfile $DAEMON -f $configfile
|
41
|
+
fi ;
|
42
|
+
} ; done
|
43
|
+
}
|
44
|
+
|
45
|
+
function do_stop() {
|
46
|
+
configs | while read c ; do {
|
47
|
+
n="$(echo $c | awk -F "," '{ print $1; }')"
|
48
|
+
pidfile=/var/run/${NAME}_${n}.pid
|
49
|
+
|
50
|
+
log_daemon_msg "Stopping glusterfs server for ${n}" "glusterfsd"
|
51
|
+
start-stop-daemon --stop --quiet --oknodo --pidfile $pidfile
|
52
|
+
log_end_msg $?
|
53
|
+
rm -f $pidfile
|
54
|
+
killproc -p $pidfile $DAEMON ;
|
55
|
+
} ; done
|
56
|
+
}
|
57
|
+
|
58
|
+
function do_status() {
|
59
|
+
exit_status=0
|
60
|
+
configs | while read c ; do {
|
61
|
+
n="$(echo $c | awk -F "," '{ print $1; }')"
|
62
|
+
pidfile=/var/run/${NAME}_${n}.pid
|
63
|
+
|
64
|
+
pidofproc -p $pidfile $DAEMON >/dev/null
|
65
|
+
status=$?
|
66
|
+
if [ $status -eq 0 ]; then
|
67
|
+
log_success_msg "glusterfs server for ${n} is running with pid $(test -f $pidfile && cat $pidfile)"
|
68
|
+
else
|
69
|
+
log_failure_msg "glusterfs server for ${n} is not running."
|
70
|
+
exit_status=$status
|
71
|
+
fi;
|
72
|
+
} ; done
|
73
|
+
exit $exit_status
|
74
|
+
}
|
75
|
+
|
76
|
+
case "$1" in
|
77
|
+
start)
|
78
|
+
do_start
|
79
|
+
;;
|
80
|
+
stop)
|
81
|
+
do_stop
|
82
|
+
;;
|
83
|
+
status)
|
84
|
+
do_status
|
85
|
+
;;
|
86
|
+
restart|force-reload)
|
87
|
+
do_stop
|
88
|
+
sleep 2
|
89
|
+
do_start
|
90
|
+
;;
|
91
|
+
*)
|
92
|
+
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
93
|
+
exit 3
|
94
|
+
;;
|
95
|
+
esac
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<cluster name="<%= redhat_cluster_name %>" config_version="<%= redhat_cluster_config_version %>">
|
3
|
+
<cman>
|
4
|
+
</cman>
|
5
|
+
<clusternodes>
|
6
|
+
<clusternodes>
|
7
|
+
<% count=1
|
8
|
+
redhat_cluster_nodes.each do |node| %>
|
9
|
+
<clusternode name="<%= node[:name] %>" nodeid="<%= count %>">
|
10
|
+
<fence><% redhat_cluster_fence_methods.each do |meth| %>
|
11
|
+
<method name="<%= meth[:name] %>">
|
12
|
+
<device name="<%= meth[:device_name] %>" nodename="<%= node[:name] %>"/>
|
13
|
+
</method><% end %>
|
14
|
+
</fence>
|
15
|
+
</clusternode>
|
16
|
+
<% count+=1 ; end %>
|
17
|
+
</clusternodes>
|
18
|
+
<fencedevices><% redhat_cluster_fence_methods.each do |meth| %>
|
19
|
+
<fencedevice name="<%= meth[:device_name] %>" <% meth[:options].each do |k,v| %><%= "#{k}=\"#{v}\" " %><% end %> /><% end %>
|
20
|
+
</fencedevices>
|
21
|
+
</cluster>
|
@@ -0,0 +1 @@
|
|
1
|
+
# <server> <options>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<cluster name="<%= redhat_cluster_name %>" config_version="<%= redhat_cluster_config_version %>">
|
3
|
+
<cman>
|
4
|
+
</cman>
|
5
|
+
<clusternodes>
|
6
|
+
<% count=1
|
7
|
+
redhat_cluster_nodes.each do |node| %>
|
8
|
+
<clusternode name="<%= node[:name] %>" nodeid="<%= count %>">
|
9
|
+
<fence><% redhat_cluster_fence_methods.each do |meth| %>
|
10
|
+
<method name="<%= meth[:name] %>">
|
11
|
+
<device name="<%= meth[:device_name] %>" nodename="<%= node[:name] %>"/>
|
12
|
+
</method><% end %>
|
13
|
+
</fence>
|
14
|
+
</clusternode>
|
15
|
+
<% count+=1 ; end %>
|
16
|
+
</clusternodes>
|
17
|
+
<fencedevices><% redhat_cluster_fence_methods.each do |meth| %>
|
18
|
+
<fencedevice name="<%= meth[:device_name] %>" <% meth[:options].each do |k,v| %><%= "#{k}=\"#{v}\" " %><% end %> /><% end %>
|
19
|
+
</fencedevices>
|
20
|
+
</cluster>
|
@@ -0,0 +1 @@
|
|
1
|
+
# GNBD_OPTIONS=""
|
@@ -0,0 +1 @@
|
|
1
|
+
# <device> <exportname> <options>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#! /bin/sh
|
2
|
+
|
3
|
+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
4
|
+
DAEMON=/usr/local/bin/god
|
5
|
+
NAME=god
|
6
|
+
DESC=god
|
7
|
+
PIDFILE=/var/run/god.pid
|
8
|
+
LOGFILE=/var/log/god.log
|
9
|
+
DAEMON_ARGS="-c /etc/god/god.conf -P $PIDFILE -l $LOGFILE --no-syslog"
|
10
|
+
|
11
|
+
test "$(id -u)" = "0" || exit 0
|
12
|
+
test -x $DAEMON || exit 0
|
13
|
+
|
14
|
+
set -e
|
15
|
+
|
16
|
+
case "$1" in
|
17
|
+
start)
|
18
|
+
echo -n "Starting $DESC: "
|
19
|
+
if $DAEMON $DAEMON_ARGS
|
20
|
+
then
|
21
|
+
echo "$NAME."
|
22
|
+
else
|
23
|
+
echo "failed"
|
24
|
+
fi
|
25
|
+
;;
|
26
|
+
stop)
|
27
|
+
echo -n "Stopping $DESC: "
|
28
|
+
if $DAEMON quit
|
29
|
+
then
|
30
|
+
echo "$NAME."
|
31
|
+
else
|
32
|
+
echo "failed"
|
33
|
+
fi
|
34
|
+
rm -f $PIDFILE
|
35
|
+
;;
|
36
|
+
|
37
|
+
restart|force-reload)
|
38
|
+
${0} stop
|
39
|
+
${0} start
|
40
|
+
;;
|
41
|
+
*)
|
42
|
+
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
|
43
|
+
exit 1
|
44
|
+
;;
|
45
|
+
esac
|
46
|
+
|
47
|
+
exit 0
|
@@ -0,0 +1,120 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
### BEGIN INIT INFO
|
3
|
+
# Provides: haproxy
|
4
|
+
# Required-Start: $local_fs $network
|
5
|
+
# Required-Stop: $local_fs
|
6
|
+
# Default-Start: 2 3 4 5
|
7
|
+
# Default-Stop: 0 1 6
|
8
|
+
# Short-Description: fast and reliable load balancing reverse proxy
|
9
|
+
# Description: This file should be used to start and stop haproxy.
|
10
|
+
### END INIT INFO
|
11
|
+
|
12
|
+
# Author: Arnaud Cornet <acornet@debian.org>
|
13
|
+
|
14
|
+
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
15
|
+
PIDFILE=/var/run/haproxy.pid
|
16
|
+
HAPROXY=/usr/local/sbin/haproxy
|
17
|
+
CONFIG=/etc/haproxy.cfg
|
18
|
+
EXTRAOPTS=
|
19
|
+
ENABLED=1
|
20
|
+
|
21
|
+
test -x $HAPROXY || exit 0
|
22
|
+
test -f "$CONFIG" || exit 0
|
23
|
+
|
24
|
+
if [ -e /etc/default/haproxy ]; then
|
25
|
+
. /etc/default/haproxy
|
26
|
+
fi
|
27
|
+
|
28
|
+
test "$ENABLED" != "0" || exit 0
|
29
|
+
|
30
|
+
[ -f /etc/default/rcS ] && . /etc/default/rcS
|
31
|
+
. /lib/lsb/init-functions
|
32
|
+
|
33
|
+
|
34
|
+
haproxy_start()
|
35
|
+
{
|
36
|
+
start-stop-daemon --start --pidfile "$PIDFILE" \
|
37
|
+
--exec $HAPROXY -- -f "$CONFIG" -D -p "$PIDFILE" \
|
38
|
+
$EXTRAOPTS || return 2
|
39
|
+
return 0
|
40
|
+
}
|
41
|
+
|
42
|
+
haproxy_stop()
|
43
|
+
{
|
44
|
+
start-stop-daemon --stop --user root --pidfile "$PIDFILE" \
|
45
|
+
|| return 2
|
46
|
+
return 0
|
47
|
+
}
|
48
|
+
|
49
|
+
haproxy_reload()
|
50
|
+
{
|
51
|
+
|
52
|
+
# haproxy -f /etc/haproxy.conf -sf `cat /var/run/haproxy.pid`
|
53
|
+
$HAPROXY -f "$CONFIG" -sf `cat $PIDFILE` || return 2
|
54
|
+
return 0
|
55
|
+
}
|
56
|
+
|
57
|
+
case "$1" in
|
58
|
+
start)
|
59
|
+
log_daemon_msg "Starting haproxy" "haproxy"
|
60
|
+
haproxy_start
|
61
|
+
case "$?" in
|
62
|
+
0)
|
63
|
+
log_end_msg 0
|
64
|
+
;;
|
65
|
+
1)
|
66
|
+
log_end_msg 1
|
67
|
+
echo "pid file '$PIDFILE' found, haproxy not started."
|
68
|
+
;;
|
69
|
+
2)
|
70
|
+
log_end_msg 1
|
71
|
+
;;
|
72
|
+
esac
|
73
|
+
;;
|
74
|
+
stop)
|
75
|
+
log_daemon_msg "Stopping haproxy" "haproxy"
|
76
|
+
haproxy_stop
|
77
|
+
case "$?" in
|
78
|
+
0|1)
|
79
|
+
log_end_msg 0
|
80
|
+
;;
|
81
|
+
2)
|
82
|
+
log_end_msg 1
|
83
|
+
;;
|
84
|
+
esac
|
85
|
+
;;
|
86
|
+
reload|force-reload)
|
87
|
+
log_daemon_msg "Reloading haproxy" "haproxy"
|
88
|
+
haproxy_reload
|
89
|
+
case "$?" in
|
90
|
+
0|1)
|
91
|
+
log_end_msg 0
|
92
|
+
;;
|
93
|
+
2)
|
94
|
+
log_end_msg 1
|
95
|
+
;;
|
96
|
+
esac
|
97
|
+
;;
|
98
|
+
restart)
|
99
|
+
log_daemon_msg "Restarting haproxy" "haproxy"
|
100
|
+
haproxy_stop
|
101
|
+
haproxy_start
|
102
|
+
case "$?" in
|
103
|
+
0)
|
104
|
+
log_end_msg 0
|
105
|
+
;;
|
106
|
+
1)
|
107
|
+
log_end_msg 1
|
108
|
+
;;
|
109
|
+
2)
|
110
|
+
log_end_msg 1
|
111
|
+
;;
|
112
|
+
esac
|
113
|
+
;;
|
114
|
+
*)
|
115
|
+
echo "Usage: /etc/init.d/haproxy {start|stop|reload|restart}"
|
116
|
+
exit 3
|
117
|
+
;;
|
118
|
+
esac
|
119
|
+
|
120
|
+
:
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# /etc/haproxy.cfg
|
2
|
+
#
|
3
|
+
# Reload gracefully with:
|
4
|
+
#
|
5
|
+
# haproxy -f /etc/haproxy.cfg -sf `cat /var/run/haproxy.pid`
|
6
|
+
#
|
7
|
+
global
|
8
|
+
log /var/log/haproxy.log daemon info
|
9
|
+
maxconn 4096
|
10
|
+
pidfile /var/run/haproxy.pid
|
11
|
+
daemon
|
12
|
+
|
13
|
+
defaults
|
14
|
+
option forwardfor
|
15
|
+
stats enable
|
16
|
+
stats auth myuser:mypass
|
17
|
+
balance roundrobin
|
18
|
+
option httpclose
|
19
|
+
mode http
|
20
|
+
retries 3
|
21
|
+
option redispatch
|
22
|
+
maxconn 2000
|
23
|
+
contimeout 5000
|
24
|
+
clitimeout 50000
|
25
|
+
srvtimeout 50000
|
26
|
+
|
27
|
+
listen example_lb *:81
|
28
|
+
option httpchk HEAD /check.txt HTTP/1.0
|
29
|
+
server web1 127.0.0.1:80 weight 6 maxconn 12 check # cookie A
|
30
|
+
server web2 127.0.0.1:80 weight 10 maxconn 12 check # cookie B
|
31
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# http://linux-ha.org/ha.cf
|
2
|
+
logfacility daemon
|
3
|
+
keepalive 1
|
4
|
+
deadtime 10
|
5
|
+
warntime 5
|
6
|
+
initdead 120 # depend on your hardware
|
7
|
+
udpport 694
|
8
|
+
ping <%= heartbeat_ping %>
|
9
|
+
bcast <%= heartbeat_bcast %>
|
10
|
+
auto_failback <%= heartbeat_auto_failback %>
|
11
|
+
<% heartbeat_nodes.each do |node| -%>
|
12
|
+
node <%= node %>
|
13
|
+
<% end -%>
|
14
|
+
respawn hacluster /usr/lib/heartbeat/ipfail
|
15
|
+
use_logd yes
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= heartbeat_preferred_node %> <%= heartbeat_resources %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "rubygems"
|
3
|
+
require "integrity"
|
4
|
+
|
5
|
+
# If you want to add any notifiers, install the gems and then require them here
|
6
|
+
# For example, to enable the Email notifier: install the gem (from github:
|
7
|
+
#
|
8
|
+
# sudo gem install -s http://gems.github.com foca-integrity-email
|
9
|
+
#
|
10
|
+
# And then uncomment the following line:
|
11
|
+
#
|
12
|
+
# require "notifier/email"
|
13
|
+
|
14
|
+
# Load configuration and initialize Integrity
|
15
|
+
Integrity.new(File.dirname(__FILE__) + "/config.yml")
|
16
|
+
|
17
|
+
# You probably don't want to edit anything below
|
18
|
+
Integrity::App.set :environment, ENV["RACK_ENV"] || :production
|
19
|
+
Integrity::App.set :port, 8910
|
20
|
+
|
21
|
+
run Integrity::App
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Domain where integrity will be running from. This is used to have
|
2
|
+
# nice URLs in your notifications.
|
3
|
+
# For example:
|
4
|
+
# http://builder.integrityapp.com
|
5
|
+
:base_uri: http://<%= integrity_domain %>
|
6
|
+
|
7
|
+
# This should be a complete connection string to your database.
|
8
|
+
#
|
9
|
+
# Examples:
|
10
|
+
# * `mysql://user:password@localhost/integrity`
|
11
|
+
# * `postgres://user:password@localhost/integrity`
|
12
|
+
# * `sqlite3:///home/integrity/db/integrity.sqlite`
|
13
|
+
#
|
14
|
+
# Note:
|
15
|
+
# * The appropriate data_objects adapter must be installed (`do_mysql`, etc)
|
16
|
+
# * You must create the `integrity` database on localhost, of course.
|
17
|
+
:database_uri: sqlite3:///<%= integrity_install_dir %>/integrity.db
|
18
|
+
|
19
|
+
# This is where your project's code will be checked out to. Make sure it's
|
20
|
+
# writable by the user that runs Integrity.
|
21
|
+
:export_directory: <%= integrity_install_dir %>/builds
|
22
|
+
|
23
|
+
# Path to the integrity log file
|
24
|
+
:log: <%= integrity_install_dir %>/log/integrity.log
|
25
|
+
|
26
|
+
# Enable or disable HTTP authentication for the app. BE AWARE that if you
|
27
|
+
# disable this anyone can delete and alter projects, so do it only if your
|
28
|
+
# app is running in a controlled environment (ie, behind your company's
|
29
|
+
# firewall.)
|
30
|
+
:use_basic_auth: <%= integrity_use_basic_auth %>
|
31
|
+
|
32
|
+
<%- if integrity_use_basic_auth -%>
|
33
|
+
# When `use_basic_auth` is true, the admin's username for HTTP authentication.
|
34
|
+
:admin_username: <%= integrity_admin_username %>
|
35
|
+
|
36
|
+
# When `use_basic_auth` is true, the admin's password. Usually saved as a
|
37
|
+
# SHA1 hash. See the next option.
|
38
|
+
:admin_password: <%= integrity_hash_admin_password ? SHA1::hexdigest(integrity_admin_password) : integrity_admin_password %>
|
39
|
+
|
40
|
+
# If this is true, then whenever we authenticate the admin user, will hash
|
41
|
+
# it using SHA1. If not, we'll assume the provided password is in plain text.
|
42
|
+
:hash_admin_password: <%= integrity_hash_admin_password %>
|
43
|
+
<%- end -%>
|