cloudfoundry/vcap — Issue #142: bin/vcap restart fails under multi host configuration
Author: yssk22r
Created: 2011-11-11 14:33:17+00:00
State: open

Hi,

I tested the latest cloudfoundry, and found an issue at vcap script.

Reproduce procedure is as follows:

- Install only 'core' components.
- execute ${VCAP_HOME}/bin/vcap restart router

then fails with:

vcap@chef-client:~/cloudfoundry/enabled$ ./bin/vcap restart router
DEPRECATION WARNING: Yajl's JSON gem compatibility API is going to be removed in 2.0
router :	STOPPED
./bin/vcap:79:in `read': No such file or directory - ./bin/../services/redis/config/redis_gateway.yml (Errno::ENOENT)
from ./bin/vcap:79:in `configuration'
from ./bin/vcap:83:in `pid_file'
from ./bin/vcap:96:in `pid'
from ./bin/vcap:105:in `running?'
from ./bin/vcap:315:in `block in stop_cleanup'
from ./bin/vcap:315:in `select'
from ./bin/vcap:315:in `stop_cleanup'
from ./bin/vcap:325:in `stop'
from ./bin/vcap:329:in `restart'
from ./bin/vcap:609:in `

'

This is due to loading @configuration_path of the service which is not installed on the node.

And I found work around to check configuration path in Component#exists? method.

$ diff vcap vcap.workaround
74c74
< File.exists? @path
---
> (File.exists? @path) && (File.exists? @configuration_path)

I wonder the definition of the existance of a component is correct or not so I'd like you to fix this issue with the proper way.