le1t0-deprec 2.1.6.064 → 2.1.6.065
Sign up to get free protection for your applications and to get access to all the features.
@@ -3,47 +3,81 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
3
3
|
namespace :deprec do
|
4
4
|
namespace :memcache do
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
set :memcache_ip, '127.0.0.1'
|
7
|
+
set :memcache_port, 11211
|
8
|
+
set :memcache_memory, 256
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
SYSTEM_CONFIG_FILES[:memcache] = [
|
11
|
+
|
12
|
+
{:template => "memcache-init.d",
|
13
|
+
:path => '/etc/init.d/memcached',
|
14
|
+
:mode => 0755,
|
15
|
+
:owner => 'root:root'}
|
16
|
+
|
17
|
+
]
|
14
18
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
+
task :install do
|
20
|
+
version = 'memcached-1.4.5'
|
21
|
+
set :src_package, {
|
22
|
+
:file => version + '.tar.gz',
|
23
|
+
:md5sum => '583441a25f937360624024f2881e5ea8 memcached-1.4.5.tar.gz',
|
24
|
+
:dir => version,
|
25
|
+
:url => "http://memcached.googlecode.com/files/#{version}.tar.gz",
|
26
|
+
:unpack => "tar zxf #{version}.tar.gz;",
|
27
|
+
:configure => %w{
|
28
|
+
./configure
|
29
|
+
--prefix=/usr/local
|
30
|
+
;
|
31
|
+
}.reject{|arg| arg.match '#'}.join(' '),
|
32
|
+
:make => 'make;',
|
33
|
+
:install => 'make install;'
|
34
|
+
}
|
35
|
+
apt.install( {:base => %w(libevent-dev)}, :stable )
|
36
|
+
deprec.download_src(src_package, src_dir)
|
37
|
+
deprec.install_from_src(src_package, src_dir)
|
38
|
+
end
|
19
39
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
40
|
+
desc "Generate memcached configs"
|
41
|
+
task :config_gen do
|
42
|
+
SYSTEM_CONFIG_FILES[:memcache].each do |file|
|
43
|
+
deprec2.render_template(:memcache, file)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
desc "Push memcached config files (system & project level) to server"
|
48
|
+
task :config, :roles => :memcached do
|
49
|
+
deprec2.push_configs(:memcache, SYSTEM_CONFIG_FILES[:memcache])
|
50
|
+
reload
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "Start memcached"
|
54
|
+
task :start, :roles => :memcached do
|
55
|
+
run "#{sudo} /etc/init.d/memcached start"
|
56
|
+
end
|
25
57
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
:
|
33
|
-
|
34
|
-
|
35
|
-
./configure
|
36
|
-
--prefix=/usr/local
|
37
|
-
;
|
38
|
-
}.reject{|arg| arg.match '#'}.join(' '),
|
39
|
-
:make => 'make;',
|
40
|
-
:install => 'make install;',
|
41
|
-
:post_install => 'install -b scripts/memcached-init /etc/init.d/memcached;'
|
42
|
-
}
|
43
|
-
apt.install( {:base => %w(libevent-dev)}, :stable )
|
44
|
-
deprec.download_src(src_package, src_dir)
|
45
|
-
deprec.install_from_src(src_package, src_dir)
|
46
|
-
end
|
47
|
-
end end
|
58
|
+
desc "Stop memcached"
|
59
|
+
task :stop, :roles => :memcached do
|
60
|
+
run "#{sudo} /etc/init.d/memcached stop"
|
61
|
+
end
|
62
|
+
|
63
|
+
desc "Restart memcached"
|
64
|
+
task :restart, :roles => :memcached do
|
65
|
+
run "#{sudo} /etc/init.d/memcached restart"
|
66
|
+
end
|
48
67
|
|
68
|
+
desc "Reload memcached"
|
69
|
+
task :reload, :roles => :memcached do
|
70
|
+
run "#{sudo} /etc/init.d/memcached force-reload"
|
71
|
+
end
|
72
|
+
|
73
|
+
task :activate, :roles => :memcached do
|
74
|
+
run "#{sudo} update-rc.d memcached defaults"
|
75
|
+
end
|
76
|
+
|
77
|
+
task :deactivate, :roles => :memcached do
|
78
|
+
run "#{sudo} update-rc.d -f memcached remove"
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
49
83
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
4
|
+
DAEMON=/usr/local/bin/memcached
|
5
|
+
DAEMONBOOTSTRAP=/usr/local/share/memcached/scripts/start-memcached
|
6
|
+
NAME=memcached
|
7
|
+
DESC=memcached
|
8
|
+
PIDFILE=/var/run/$NAME.pid
|
9
|
+
|
10
|
+
test -x $DAEMON || exit 0
|
11
|
+
test -x $DAEMONBOOTSTRAP || exit 0
|
12
|
+
|
13
|
+
set -e
|
14
|
+
|
15
|
+
case "$1" in
|
16
|
+
start)
|
17
|
+
echo -n "Starting $DESC: "
|
18
|
+
start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP -- -d -m <%= memcache_memory %> -l <%= memcache_ip %> -p <%= memcache_port %>
|
19
|
+
echo "$NAME."
|
20
|
+
;;
|
21
|
+
stop)
|
22
|
+
echo -n "Stopping $DESC: "
|
23
|
+
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
|
24
|
+
echo "$NAME."
|
25
|
+
rm -f $PIDFILE
|
26
|
+
;;
|
27
|
+
|
28
|
+
restart|force-reload)
|
29
|
+
echo -n "Restarting $DESC: "
|
30
|
+
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
|
31
|
+
rm -f $PIDFILE
|
32
|
+
sleep 1
|
33
|
+
start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP
|
34
|
+
echo "$NAME."
|
35
|
+
;;
|
36
|
+
*)
|
37
|
+
N=/etc/init.d/$NAME
|
38
|
+
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
39
|
+
exit 1
|
40
|
+
;;
|
41
|
+
esac
|
42
|
+
|
43
|
+
exit 0
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: le1t0-deprec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 255
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 2
|
8
7
|
- 1
|
9
8
|
- 6
|
10
|
-
-
|
11
|
-
version: 2.1.6.
|
9
|
+
- 65
|
10
|
+
version: 2.1.6.065
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Le1t0
|
@@ -16,7 +15,7 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date:
|
18
|
+
date: 2011-01-18 00:00:00 +01:00
|
20
19
|
default_executable: depify
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
@@ -27,7 +26,6 @@ dependencies:
|
|
27
26
|
requirements:
|
28
27
|
- - "="
|
29
28
|
- !ruby/object:Gem::Version
|
30
|
-
hash: 35
|
31
29
|
segments:
|
32
30
|
- 2
|
33
31
|
- 5
|
@@ -171,6 +169,7 @@ files:
|
|
171
169
|
- lib/deprec/templates/keepalived/keepalived-init.erb
|
172
170
|
- lib/deprec/templates/keepalived/keepalived.conf.erb
|
173
171
|
- lib/deprec/templates/logrotate/logrotate.conf.erb
|
172
|
+
- lib/deprec/templates/memcache/memcache-init.d
|
174
173
|
- lib/deprec/templates/mongodb/mongodb-init.d
|
175
174
|
- lib/deprec/templates/mongrel/apache_vhost.conf.erb
|
176
175
|
- lib/deprec/templates/mongrel/logrotate.conf.erb
|
@@ -290,7 +289,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
290
289
|
requirements:
|
291
290
|
- - ">="
|
292
291
|
- !ruby/object:Gem::Version
|
293
|
-
hash: 3
|
294
292
|
segments:
|
295
293
|
- 0
|
296
294
|
version: "0"
|
@@ -299,7 +297,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
299
297
|
requirements:
|
300
298
|
- - ">="
|
301
299
|
- !ruby/object:Gem::Version
|
302
|
-
hash: 3
|
303
300
|
segments:
|
304
301
|
- 0
|
305
302
|
version: "0"
|