{"action":"created","issue":{"url":"https://api.github.com/repos/Metaswitch/clearwater-monit/issues/18","labels_url":"https://api.github.com/repos/Metaswitch/clearwater-monit/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/Metaswitch/clearwater-monit/issues/18/comments","events_url":"https://api.github.com/repos/Metaswitch/clearwater-monit/issues/18/events","html_url":"https://github.com/Metaswitch/clearwater-monit/issues/18","id":87311309,"number":18,"title":"clearwater-monit not running after a reboot","user":{"login":"dtheobald","id":6430927,"avatar_url":"https://avatars.githubusercontent.com/u/6430927?v=3","gravatar_id":"","url":"https://api.github.com/users/dtheobald","html_url":"https://github.com/dtheobald","followers_url":"https://api.github.com/users/dtheobald/followers","following_url":"https://api.github.com/users/dtheobald/following{/other_user}","gists_url":"https://api.github.com/users/dtheobald/gists{/gist_id}","starred_url":"https://api.github.com/users/dtheobald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtheobald/subscriptions","organizations_url":"https://api.github.com/users/dtheobald/orgs","repos_url":"https://api.github.com/users/dtheobald/repos","events_url":"https://api.github.com/users/dtheobald/events{/privacy}","received_events_url":"https://api.github.com/users/dtheobald/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Metaswitch/clearwater-monit/labels/high-priority","name":"high-priority","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"dtheobald","id":6430927,"avatar_url":"https://avatars.githubusercontent.com/u/6430927?v=3","gravatar_id":"","url":"https://api.github.com/users/dtheobald","html_url":"https://github.com/dtheobald","followers_url":"https://api.github.com/users/dtheobald/followers","following_url":"https://api.github.com/users/dtheobald/following{/other_user}","gists_url":"https://api.github.com/users/dtheobald/gists{/gist_id}","starred_url":"https://api.github.com/users/dtheobald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtheobald/subscriptions","organizations_url":"https://api.github.com/users/dtheobald/orgs","repos_url":"https://api.github.com/users/dtheobald/repos","events_url":"https://api.github.com/users/dtheobald/events{/privacy}","received_events_url":"https://api.github.com/users/dtheobald/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-06-11T11:32:07Z","updated_at":"2015-06-15T12:46:58Z","closed_at":null,"body":"Sporadically, clearwater-monit is not running after a reboot. This sometimes prevents clearwater processes from starting, since some initially fail and rely on monit for a restart. \r\n\r\nThe logs look like:\r\n```\r\nkernel: [   19.042091] init: clearwater-monit main process (2460) killed by HUP signal\r\nkernel: [   19.042106] init: clearwater-monit main process ended, respawning\r\n```\r\nYet clearwater-monit was not re-spawned.\r\n\r\nI've done some investigation and have found this Ubuntu bug thread that sounds suspiciously similar - http://ubuntu-bugs.narkive.com/swLa01tj/bug-1332131-re-avahi-cups-reload-upstart-job-leads-to-weird-race-conditions.\r\n"},"comment":{"url":"https://api.github.com/repos/Metaswitch/clearwater-monit/issues/comments/112054085","html_url":"https://github.com/Metaswitch/clearwater-monit/issues/18#issuecomment-112054085","issue_url":"https://api.github.com/repos/Metaswitch/clearwater-monit/issues/18","id":112054085,"user":{"login":"dtheobald","id":6430927,"avatar_url":"https://avatars.githubusercontent.com/u/6430927?v=3","gravatar_id":"","url":"https://api.github.com/users/dtheobald","html_url":"https://github.com/dtheobald","followers_url":"https://api.github.com/users/dtheobald/followers","following_url":"https://api.github.com/users/dtheobald/following{/other_user}","gists_url":"https://api.github.com/users/dtheobald/gists{/gist_id}","starred_url":"https://api.github.com/users/dtheobald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtheobald/subscriptions","organizations_url":"https://api.github.com/users/dtheobald/orgs","repos_url":"https://api.github.com/users/dtheobald/repos","events_url":"https://api.github.com/users/dtheobald/events{/privacy}","received_events_url":"https://api.github.com/users/dtheobald/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T12:46:58Z","updated_at":"2015-06-15T12:46:58Z","body":"I only had that in the script temporarily, so it was never checked in, but it went like this:\r\n```\r\npost-start script\r\n    set +e\r\n    logger \"clearwater-monit start\"\r\n    . /etc/clearwater/config\r\n    netstat -na | grep \"LISTEN\" | awk '{ print $4 }' | grep -q \":2812\\$\"\r\n    while [ $? -ne 0 ]; do\r\n        sleep 1\r\n        netstat -na | grep \"LISTEN\" | awk '{ print $4 }' | grep -q \":2812\\$\"\r\n    done\r\n    logger \"clearwater-monit started\"\r\nend script\r\n```\r\n"}}