Sha256: acd98dc0ed741df77b3548905423c4165d201b29403059de47d8bedf1def675d

Contents?: true

Size: 925 Bytes

Versions: 5

Compression:

Stored size: 925 Bytes

Contents

Capistrano::Configuration.instance(true).load do

  set :memcache_init_path, "/etc/init.d/memcached"
  set :memcache_size, '64'
  set :memcache_port, '11211'
  set :memcache_host, '127.0.0.1'
  set :memcache_user, 'nobody'

  namespace :memcache do
    
    desc "Stops the memcache server"
    task :stop, :roles => :app do
      puts "Stopping the memcache server"
      try_sudo "killall -s TERM memcached" 
    end

    desc "Starts the memcache server"
    task :start, :roles => :app do
      puts "Starting the memcache server"
      try_sudo "memcached -d -m #{memcache_size} -p #{memcache_port} -l #{memcache_host} -u #{memcache_user}"
    end

    desc "Restarts the memcache server"
    task :restart, :roles => :app do
      puts "Restarting the memcache server"
      memcache.stop
      sleep(3)  # sleep for 3 seconds to make sure the server has mopped up everything
      memcache.start
    end
    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nesquena-cap-recipes-0.3.4 lib/cap_recipes/tasks/memcache/manage.rb
nesquena-cap-recipes-0.3.5 lib/cap_recipes/tasks/memcache/manage.rb
nesquena-cap-recipes-0.3.7 lib/cap_recipes/tasks/memcache/manage.rb
nesquena-cap-recipes-0.3.8 lib/cap_recipes/tasks/memcache/manage.rb
nesquena-cap-recipes-0.3.9 lib/cap_recipes/tasks/memcache/manage.rb