{"action":"created","issue":{"url":"https://api.github.com/repos/weaveworks/weave/issues/784","labels_url":"https://api.github.com/repos/weaveworks/weave/issues/784/labels{/name}","comments_url":"https://api.github.com/repos/weaveworks/weave/issues/784/comments","events_url":"https://api.github.com/repos/weaveworks/weave/issues/784/events","html_url":"https://github.com/weaveworks/weave/issues/784","id":82044841,"number":784,"title":"`weave status` should only succeed if weave is running","user":{"login":"MaximeHeckel","id":2974412,"avatar_url":"https://avatars.githubusercontent.com/u/2974412?v=3","gravatar_id":"","url":"https://api.github.com/users/MaximeHeckel","html_url":"https://github.com/MaximeHeckel","followers_url":"https://api.github.com/users/MaximeHeckel/followers","following_url":"https://api.github.com/users/MaximeHeckel/following{/other_user}","gists_url":"https://api.github.com/users/MaximeHeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/MaximeHeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaximeHeckel/subscriptions","organizations_url":"https://api.github.com/users/MaximeHeckel/orgs","repos_url":"https://api.github.com/users/MaximeHeckel/repos","events_url":"https://api.github.com/users/MaximeHeckel/events{/privacy}","received_events_url":"https://api.github.com/users/MaximeHeckel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/weaveworks/weave/labels/feature","name":"feature","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-28T17:37:43Z","updated_at":"2015-05-28T17:49:11Z","closed_at":null,"body":"I recently encountered a strange issue when executing the command `weave --local status` in a script where I set `set -e` at the beginning.\r\nThe weave container was stopped at that moment and this command printed the following message  ...\r\n\r\n```\r\nweave container is not present; have you launched it?\r\n\r\n```\r\n\r\n\r\n... and the script kept going without exiting ! \r\n\r\nI think it might be due to a wrong exit code.\r\n\r\nAs a workaround, I needed to do that\r\n`/weave --local status | grep -qv \"weave container is not present; have you launched it?\"`"},"comment":{"url":"https://api.github.com/repos/weaveworks/weave/issues/comments/106524036","html_url":"https://github.com/weaveworks/weave/issues/784#issuecomment-106524036","issue_url":"https://api.github.com/repos/weaveworks/weave/issues/784","id":106524036,"user":{"login":"rade","id":109109,"avatar_url":"https://avatars.githubusercontent.com/u/109109?v=3","gravatar_id":"","url":"https://api.github.com/users/rade","html_url":"https://github.com/rade","followers_url":"https://api.github.com/users/rade/followers","following_url":"https://api.github.com/users/rade/following{/other_user}","gists_url":"https://api.github.com/users/rade/gists{/gist_id}","starred_url":"https://api.github.com/users/rade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rade/subscriptions","organizations_url":"https://api.github.com/users/rade/orgs","repos_url":"https://api.github.com/users/rade/repos","events_url":"https://api.github.com/users/rade/events{/privacy}","received_events_url":"https://api.github.com/users/rade/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T17:49:11Z","updated_at":"2015-05-28T17:49:11Z","body":"The script deliberately returns 0.\r\n\r\nPerhaps that is not all that useful.\r\n\r\nThe issue is that it's not clear what should happen when weave isn't running but weavedns is, or vice versa.\r\n\r\nweavedns is optional, so returning a non-zero status when that isn't there seems wrong.\r\n\r\nAnd you may still want to see the weavedns status even when weave isn't running.\r\n\r\nSo I guess we could make the script return a non-zero status when weave isn't running, but still show the weavedns status (and always ignore any errors from that)."}}