Sha256: 3845e06572b36cb05328a29ad2406515d2d2af1234fd2a22eb686bd308b6c3eb

Contents?: true

Size: 974 Bytes

Versions: 10

Compression:

Stored size: 974 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
      utilities.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
      utilities.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
      utilities.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

10 entries across 10 versions & 2 rubygems

Version Path
nesquena-cap-recipes-0.3.17 lib/cap_recipes/tasks/memcache/manage.rb
nesquena-cap-recipes-0.3.18 lib/cap_recipes/tasks/memcache/manage.rb
cap-recipes-0.3.26 lib/cap_recipes/tasks/memcache/manage.rb
cap-recipes-0.3.25 lib/cap_recipes/tasks/memcache/manage.rb
cap-recipes-0.3.24 lib/cap_recipes/tasks/memcache/manage.rb
cap-recipes-0.3.23 lib/cap_recipes/tasks/memcache/manage.rb
cap-recipes-0.3.22 lib/cap_recipes/tasks/memcache/manage.rb
cap-recipes-0.3.21 lib/cap_recipes/tasks/memcache/manage.rb
cap-recipes-0.3.20 lib/cap_recipes/tasks/memcache/manage.rb
cap-recipes-0.3.18 lib/cap_recipes/tasks/memcache/manage.rb