Closed andyshinn closed 11 years ago
That looks like a problem with the package not installing riak properly after having been ensured 'created'. If you have the second output, we can see there what actions were taken that were not taken with this output.
Also, another thing I'd like to see is if you at this point ssh into the machine and run '/sbin/service riak stop'.
Which version of Riak is it installing? Assuming it's the latest -- Riak 1.4.
On Fri, Jul 26, 2013 at 2:54 AM, Henrik Feldt notifications@github.comwrote:
That looks like a problem with the package not installing riak properly after having been ensured 'created'. If you have the second output, we can see there what actions were taken that were not taken with this output.
Also, another thing I'd like to see is if you at this point ssh into the machine and run '/sbin/service riak stop'.
— Reply to this email directly or view it on GitHubhttps://github.com/basho/puppet-riak/issues/21#issuecomment-21604495 .
After the failure and SSH in to stop the service I get:
[vagrant@riak ~]$ sudo /sbin/service riak stop
[vagrant@riak ~]$ echo $?
0
At this point, the only Riak related process running is:
riak 3125 0.0 0.0 10824 432 ? S 18:07 0:00 /usr/lib64/riak/erts-5.9.1/bin/epmd -daemon
If I run vagrant provision
(to apply the Puppet manifest again) I get:
Notice: /Stage[main]/Riak/File[/etc/riak]/owner: owner changed 'riak' to 'root'
Notice: /Stage[main]/Riak/File[/etc/riak]/group: group changed 'riak' to 'root'
Notice: /Stage[main]/Riak/Service[riak]/ensure: ensure changed 'stopped' to 'running'
Notice: Finished catalog run in 2.99 seconds
At this point the service appears to be running just fine:
[vagrant@riak ~]$ riak ping
pong
If I SSH after the initial Puppet reported error I can also restart the service and it comes up just fine:
[vagrant@riak ~]$ sudo /etc/init.d/riak restart
Starting riak: [ OK ]
Oh, and yes, I am running version 1.4.0 (riak version
doesn't output anything though):
[vagrant@riak ~]$ riak version
[vagrant@riak ~]$ rpm -qa | grep riak
riak-1.4.0-1.el6.x86_64
Here is what I think is happening:
The init.d script appears to support the restart command and actually checks if it is running first:
restart|force-reload)
[ $running -eq 0 ] && stop
start
;;
I added hasrestart => true
to the service resource and it appears to be working correctly now (refresh does a restart instead of a stop / start and since it is not fully running, it does not stop, but start just exits 0).
Maybe a valid fix is adding a param for $has_restart?
The init script will always have hasrestart
, no? Perhaps a pull request? =) Thanks for the debugging you have done and your writing to explain it!
Yea, I think most init script now days have a 'restart' option. Puppet actually defaults to hasrestart => false
for the service resource. I can probably fix this up and will make a pull request, no problemo!
Whoa... I did something seriously wrong... I'll open a new pull request.
Closing
I'm trying to get a VM up in vagrant with Puppet. Everything works after the second pass. Howeverm the first pass gives me the following output and error starting (stopping?) Riak:
My Puppet manifest for this VM:
Any idea why this might be happening?