sprinkle-tool / sprinkle

Sprinkle is a software provisioning tool you can use to build remote servers with. eg. to install a Rails, or Sinatra stack on a brand new slice directly after its been created
https://github.com/sprinkle-tool/sprinkle
MIT License
1.15k stars 138 forks source link

Post install task not completing? #177

Closed jdguzman closed 11 years ago

jdguzman commented 11 years ago

I have the following install task:

redis_init_script = File.expand_path('../../../templates/debian/redis_init.erb', __FILE__)
file '/etc/init.d/redis-server', content: render(redis_init_script), sudo: true do
  post :install do
    [
      'sudo chmod +x /etc/init.d/redis-server',
      'sudo update-rc.d redis-server defaults',
      'sudo /etc/init.d/redis-server start'
    ]
  end
end

Everything seems to run ok however the server is not started for some reason. if I ssh in and do a sudo /etc/init.d/redis-server start it works fine.

These are the last few lines of the output from sprinkle.

--> Running Sprinkle::Installers::FileInstaller for roles: cache
** scp upload /var/folders/nn/tn0tt3gx4zd788h9t706vt7w0000gn/T/redis20131114-63310-rutjde -> /tmp/sprinkle_redis-server 
** [out :: 166.78.19.179] Adding system startup for /etc/init.d/redis-server ...
** [out :: 166.78.19.179] 
** [out :: 166.78.19.179] /etc/rc0.d/K20redis-server -> ../init.d/redis-server
** [out :: 166.78.19.179] 
** [out :: 166.78.19.179] /etc/rc1.d/K20redis-server -> ../init.d/redis-server
** [out :: 166.78.19.179] 
** [out :: 166.78.19.179] /etc/rc6.d/K20redis-server -> ../init.d/redis-server
** [out :: 166.78.19.179] 
** [out :: 166.78.19.179] /etc/rc2.d/S20redis-server -> ../init.d/redis-server
** [out :: 166.78.19.179] 
** [out :: 166.78.19.179] /etc/rc3.d/S20redis-server -> ../init.d/redis-server
** [out :: 166.78.19.179] 
** [out :: 166.78.19.179] /etc/rc4.d/S20redis-server -> ../init.d/redis-server
** [out :: 166.78.19.179] 
** [out :: 166.78.19.179] /etc/rc5.d/S20redis-server -> ../init.d/redis-server
** [out :: 166.78.19.179] 
** [out :: 166.78.19.179] Starting redis-server:
** [out :: 166.78.19.179] redis-server.
** [out :: 166.78.19.179] 
--> Verifying redis was properly installed for roles: cache
redis (redis) verification sequence: ps -C redis-server for roles: cache

--> Verifying  (redis)...
** [out :: 166.78.19.179] PID TTY          TIME CMD
** [out :: 166.78.19.179] 
/Users/jdg/.rvm/gems/ruby-1.9.3-p429/gems/sprinkle-0.7.6.2/lib/sprinkle/verify.rb:117:in `process': Verifying redis (redis) failed. (Sprinkle::VerificationFailed)
joshgoebel commented 11 years ago

I don't see any evidence here this is definitely a sprinkle problem. It's running your script, you see it in the output:

** [out :: 166.78.19.179] Starting redis-server:
** [out :: 166.78.19.179] redid-server.

I'm not sure why redis isn't starting, but I don't think there is enough information in just what you've posted to figure it out. Maybe it's backgrounding and needs some time to start up?

jdguzman commented 11 years ago

I've given it time. The strange thing like I said is that if I run the exact same command when ssh'd redis starts up fine and running ps -C redis-server confirms it.

I agree with you that from the output it would seem that sprinkle is doing what it's supposed to just can't figure out why the server isn't starting up.

joshgoebel commented 11 years ago

I dunno, but unless you can find something that more directly points the finger at Sprinkle not sure how I can help. Try running sprinkle in verbose mode and see if you learn anything new.

jdguzman commented 11 years ago

Well I am no where closer to knowing what was going on but I changed from an init script to upstart and sprinkle starts the redis server fine with sudo start redis-server.

joshgoebel commented 11 years ago

Closing this since there is no evidence this is a sprinkle issue. If you find evidence or find a fix, please let us know.