{"action":"opened","issue":{"url":"https://api.github.com/repos/crossbario/crossbar/issues/257","labels_url":"https://api.github.com/repos/crossbario/crossbar/issues/257/labels{/name}","comments_url":"https://api.github.com/repos/crossbario/crossbar/issues/257/comments","events_url":"https://api.github.com/repos/crossbario/crossbar/issues/257/events","html_url":"https://github.com/crossbario/crossbar/issues/257","id":58512281,"number":257,"title":"Worker doesn't restarts after kill","user":{"login":"Airborn22","id":3807921,"avatar_url":"https://avatars.githubusercontent.com/u/3807921?v=3","gravatar_id":"","url":"https://api.github.com/users/Airborn22","html_url":"https://github.com/Airborn22","followers_url":"https://api.github.com/users/Airborn22/followers","following_url":"https://api.github.com/users/Airborn22/following{/other_user}","gists_url":"https://api.github.com/users/Airborn22/gists{/gist_id}","starred_url":"https://api.github.com/users/Airborn22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Airborn22/subscriptions","organizations_url":"https://api.github.com/users/Airborn22/orgs","repos_url":"https://api.github.com/users/Airborn22/repos","events_url":"https://api.github.com/users/Airborn22/events{/privacy}","received_events_url":"https://api.github.com/users/Airborn22/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-22T18:22:27Z","updated_at":"2015-02-22T18:22:27Z","closed_at":null,"body":"Hello,\r\n\r\nI've recently created an upstart script which starts crossbar for me and restarts it if necessary. After the service is started I see 4 processes running:\r\n* `sudo -u crossbar /home/crossbar/pypy-venv/bin/crossbar start --cbdir /home/crossbar/hello/.crossbar/ --logdir /home/crossbar/hello/.crossbar/log`\r\n * This is the command started by upstart\r\n* `crossbar-controller`\r\n* `crossbar-worker [router]`\r\n* `/usr/bin/node hello.js`\r\n\r\nI was playing around and tried to kill the processes to see if everything is restarting and I noticed a few things:\r\n* The `sudo ...` command was started again after I killed it. I guess upstart is keeping track of this but I think it tries then to start crossbar again which is already running.\r\n* After killing `crossbar-controller` it is restarted but a new instance of `/usr/bin/node hello.js` appeared.\r\n* After stopping the service everything is killed but each instance of `/usr/bin/node hello.js` was kept running.\r\n* After killing `crossbar-worker [router]` it was not started again so the application died.\r\n* And `/usr/bin/node hello.js` was not started as well but the application was still functioning after that.\r\n\r\nThe upstart script I'm using:\r\n```\r\ndescription \"Start script for the crossbar hello example\"\r\nauthor \"Alex Major\"\r\n\r\nstart on startup\r\nstop on shutdown\r\nrespawn\r\n\r\nexec sudo -u crossbar /home/crossbar/pypy-venv/bin/crossbar start \\\r\n\t--cbdir /home/crossbar/hello/.crossbar/ \\\r\n\t--logdir /home/crossbar/hello/.crossbar/log\r\n```\r\n\r\nThere is a pypy virtualenv under `/home/crossbar/pypy-venv`. I'm running crossbar from there. I don't know if this upstart method is correct but it would be good to have a solution which solves the issues above.\r\n\r\nWhat I want to achieve is if I run crossbar in production then all the services will run forever. If a worker dies for example then it is getting restarted and so on."}}