{"action":"created","issue":{"url":"https://api.github.com/repos/Mic92/mina-sidekiq/issues/4","labels_url":"https://api.github.com/repos/Mic92/mina-sidekiq/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/Mic92/mina-sidekiq/issues/4/comments","events_url":"https://api.github.com/repos/Mic92/mina-sidekiq/issues/4/events","html_url":"https://github.com/Mic92/mina-sidekiq/issues/4","id":27010292,"number":4,"title":"Cannot restart sidekiq","user":{"login":"charlatan154","id":1842448,"avatar_url":"https://avatars.githubusercontent.com/u/1842448?v=3","gravatar_id":"","url":"https://api.github.com/users/charlatan154","html_url":"https://github.com/charlatan154","followers_url":"https://api.github.com/users/charlatan154/followers","following_url":"https://api.github.com/users/charlatan154/following{/other_user}","gists_url":"https://api.github.com/users/charlatan154/gists{/gist_id}","starred_url":"https://api.github.com/users/charlatan154/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlatan154/subscriptions","organizations_url":"https://api.github.com/users/charlatan154/orgs","repos_url":"https://api.github.com/users/charlatan154/repos","events_url":"https://api.github.com/users/charlatan154/events{/privacy}","received_events_url":"https://api.github.com/users/charlatan154/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":36,"created_at":"2014-02-05T22:43:59Z","updated_at":"2015-06-13T08:09:27Z","closed_at":"2015-01-18T08:42:24Z","body":"Seems that re/start doesn't work for me. The only way to start sidekiq is when i removed 'nohup' command, but then sidekiq stop running in the background after i log out from the shell. "},"comment":{"url":"https://api.github.com/repos/Mic92/mina-sidekiq/issues/comments/111686101","html_url":"https://github.com/Mic92/mina-sidekiq/issues/4#issuecomment-111686101","issue_url":"https://api.github.com/repos/Mic92/mina-sidekiq/issues/4","id":111686101,"user":{"login":"Mic92","id":96200,"avatar_url":"https://avatars.githubusercontent.com/u/96200?v=3","gravatar_id":"","url":"https://api.github.com/users/Mic92","html_url":"https://github.com/Mic92","followers_url":"https://api.github.com/users/Mic92/followers","following_url":"https://api.github.com/users/Mic92/following{/other_user}","gists_url":"https://api.github.com/users/Mic92/gists{/gist_id}","starred_url":"https://api.github.com/users/Mic92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mic92/subscriptions","organizations_url":"https://api.github.com/users/Mic92/orgs","repos_url":"https://api.github.com/users/Mic92/repos","events_url":"https://api.github.com/users/Mic92/events{/privacy}","received_events_url":"https://api.github.com/users/Mic92/received_events","type":"User","site_admin":false},"created_at":"2015-06-13T08:09:27Z","updated_at":"2015-06-13T08:09:27Z","body":"@snitko you can restrict the user with sudo to just allow certain commands to be run as root:\r\n\r\nLets stay with the upstart example:\r\n\r\n```bash\r\n#!/bin/bash\r\n#/usr/local/bin/sidekiq-service\r\n\r\ncase \"$1\" in\r\nstart)\r\n  sudo initctl start sidekiq;;\r\nstop)\r\n  sudo initctl stop sidekiq;;\r\n*)\r\n  echo \"USAGE: $0 start|stop\";;\r\nesac\r\n```\r\n\r\nAssuming that `deploy` is the deploy user put in `/etc/sudoers`:\r\n\r\n```\r\ndeploy ALL = NOPASSWD: /usr/local/bin/sidekiq-service\r\n```\r\n\r\n```ruby\r\nnamespace :sidekiq do\r\n  task start: :environment do\r\n    queue %[echo \"-----> Starting Sidekiq\"]\r\n    queue \"sudo /usr/local/bin/sidekiq-service start\"\r\n  end\r\n\r\n  task stop: :environment do\r\n    queue %[echo \"-----> Stopping Sidekiq\"]\r\n    queue \"sudo /usr/local/bin/sidekiq-service stop\"\r\n  end\r\n\r\n  task restart: :environment do\r\n    invoke :\"sidekiq:stop\"\r\n    invoke :\"sidekiq:start\"\r\n  end\r\nend\r\n```\r\n\r\n"}}