Sha256: a7593c23546d12a64b93e76f3753e4c97c06e088ef54f51c00557175d0d8b445

Contents?: true

Size: 944 Bytes

Versions: 2

Compression:

Stored size: 944 Bytes

Contents

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

  set :memcache_init_path, "/etc/init.d/memcached"
  set :memcache_role, :app

  namespace :memcache do

    desc "Stops the memcache server"
    task :stop, :roles => memcache_role do
      with_role(memcache_role) do
        puts "Stopping the memcache server"
        try_sudo "killall -s TERM memcached; true"
      end
    end

    desc "Starts the memcache server"
    task :start, :roles => memcache_role do
      with_role(memcache_role) do
        puts "Starting the memcache server"
        try_sudo "nohup /etc/init.d/memcached start"
      end
    end

    desc "Restarts the memcache server"
    task :restart, :roles => memcache_role do
      with_role(memcache_role) 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
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nesquena-cap-recipes-0.3.15 lib/cap_recipes/tasks/memcache/manage.rb
nesquena-cap-recipes-0.3.16 lib/cap_recipes/tasks/memcache/manage.rb