{"action":"created","comment":{"url":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/comments/69591385","id":69591385,"diff_hunk":"@@ -27,77 +69,73 @@ start() {\n   ulimit -n 65536\n   ulimit -s 10240\n   ulimit -c unlimited\n-  if [ -f $PID_FILE ]\n-  then\n-    PID=`cat $PID_FILE`\n-    if [ ! -z \"`ps -ef | awk '{print $2}' | grep \"^$PID$\"`\" ]\n-    then\n+  if [ -f \"$PID_FILE\" ]; then\n+    PID=`cat \"$PID_FILE\"`\n+    if [ `ps -p \"$PID\" -o pid= || echo 1` -eq `pgrep -f \"$PGREP_PATTERN\" || echo 2` ] ; then\n       echo \"$PID_FILE exists, process is already running\"\n       exit 0\n-    else\n-      echo \"$PID_FILE exists but the process is not running. Deleting $PID_FILE and re-trying\"\n-      rm -f $PID_FILE\n-      start\n-    fi\n-  else\n-    /bin/su $KAFKA_USER -c \"KAFKA_JMX_OPTS=\\\"$KAFKA_JMX_OPTS\\\" $DAEMON $DAEMON_OPTS > /var/log/kafka/server.out 2> /var/log/kafka/server.err &\"\n-    sleep 2\n-    PID=`pgrep -f kafka.Kafka`\n-    if [ -z \"$PID\" ]; then\n-        echo \"\\n $NAME could not be started\"\n-        exit 1\n-    else\n-        echo $PID > $PID_FILE;\n-        echo \"\\n$NAME started\"\n     fi\n+    echo \"$PID_FILE exists but the process is not running. Deleting $PID_FILE and re-trying\"\n+    rm -f -- \"$PID_FILE\"\n+    start\n+    return $?\n   fi\n+\n+  /bin/su \"$KAFKA_USER\" -c \"KAFKA_JMX_OPTS=\\\"$KAFKA_JMX_OPTS\\\" $DAEMON $DAEMON_OPTS<%- if @service_name == 'kafka-producer' -%> $PRODUCER_INPUT<%- end -%> >/dev/null 2>&1 &\"\n+  sleep 2\n+  PID=`pgrep -f \"$PGREP_PATTERN\"`\n+  if [ -z \"$PID\" ]; then\n+    echo \"$NAME could not be started\"\n+    exit 1\n+  fi\n+\n+  echo \"$PID\" > \"$PID_FILE\";\n+  echo \"$NAME started\"\n+  return 0\n }\n \n stop() {\n-  if [ ! -f $PID_FILE ]\n-  then\n+  if [ ! -f \"$PID_FILE\" ]; then\n     echo \"$PID_FILE does not exist, process is not running\"\n     return 1\n-  else\n-    kill `cat $PID_FILE`;\n-    rm -f $PID_FILE;\n-    echo \"$NAME stopped\"\n-    return 0\n   fi\n+\n+  kill `cat \"$PID_FILE\"`;\n+  rm -f -- \"$PID_FILE\";\n+  echo \"$NAME stopped\"\n+  return 0\n }\n \n status() {\n-  if [ -f $PID_FILE ]\n-  then\n-    PID=`cat $PID_FILE`\n-    if [ -z \"`ps -ef | awk '{print $2}' | grep \"^$PID$\"`\" ]\n-    then\n-      echo \"$NAME stopped but pid file exists\"\n-      exit 1\n-    else\n-      echo \"$NAME running with pid $PID\"\n-      exit 0\n-    fi\n-  else\n+  if [ ! -f \"$PID_FILE\" ]; then\n     echo \"$NAME stopped\"\n     exit 1\n   fi\n+\n+  PID=`cat \"$PID_FILE\"`\n+  if [ `ps -p \"$PID\" -o pid= || echo 1` -eq `pgrep -f \"$PGREP_PATTERN\" || echo 2` ] ; then","path":"templates/init.erb","position":157,"original_position":157,"commit_id":"a59ab5301ea45897c24e038e6be5ca6701e9475b","original_commit_id":"a59ab5301ea45897c24e038e6be5ca6701e9475b","user":{"login":"igalic","id":497249,"avatar_url":"https://avatars.githubusercontent.com/u/497249?v=3","gravatar_id":"","url":"https://api.github.com/users/igalic","html_url":"https://github.com/igalic","followers_url":"https://api.github.com/users/igalic/followers","following_url":"https://api.github.com/users/igalic/following{/other_user}","gists_url":"https://api.github.com/users/igalic/gists{/gist_id}","starred_url":"https://api.github.com/users/igalic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igalic/subscriptions","organizations_url":"https://api.github.com/users/igalic/orgs","repos_url":"https://api.github.com/users/igalic/repos","events_url":"https://api.github.com/users/igalic/events{/privacy}","received_events_url":"https://api.github.com/users/igalic/received_events","type":"User","site_admin":false},"body":"again, i hope this isn't too clever…","created_at":"2016-07-05T16:08:16Z","updated_at":"2016-07-05T16:08:16Z","html_url":"https://github.com/voxpupuli/puppet-kafka/pull/82#discussion_r69591385","pull_request_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/comments/69591385"},"html":{"href":"https://github.com/voxpupuli/puppet-kafka/pull/82#discussion_r69591385"},"pull_request":{"href":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/82","id":76189310,"html_url":"https://github.com/voxpupuli/puppet-kafka/pull/82","diff_url":"https://github.com/voxpupuli/puppet-kafka/pull/82.diff","patch_url":"https://github.com/voxpupuli/puppet-kafka/pull/82.patch","issue_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/issues/82","number":82,"state":"open","locked":false,"title":"[WIP] init clean-up","user":{"login":"igalic","id":497249,"avatar_url":"https://avatars.githubusercontent.com/u/497249?v=3","gravatar_id":"","url":"https://api.github.com/users/igalic","html_url":"https://github.com/igalic","followers_url":"https://api.github.com/users/igalic/followers","following_url":"https://api.github.com/users/igalic/following{/other_user}","gists_url":"https://api.github.com/users/igalic/gists{/gist_id}","starred_url":"https://api.github.com/users/igalic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igalic/subscriptions","organizations_url":"https://api.github.com/users/igalic/orgs","repos_url":"https://api.github.com/users/igalic/repos","events_url":"https://api.github.com/users/igalic/events{/privacy}","received_events_url":"https://api.github.com/users/igalic/received_events","type":"User","site_admin":false},"body":"This WIP pull request tries to clean-up our init scripts.\r\nThey are currently quadrupled (broker, consumer, mirror, producer). Unnecessarily so.\r\n\r\nThis pr will first attempt to clean up the shell scripts, then consolidate them into one template.","created_at":"2016-07-04T17:30:37Z","updated_at":"2016-07-05T16:08:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2eb732f7290ada5b1e1bac441110eeb21e22b59","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/82/commits","review_comments_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/82/comments","review_comment_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/issues/82/comments","statuses_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/statuses/a59ab5301ea45897c24e038e6be5ca6701e9475b","head":{"label":"igalic:sys-deps","ref":"sys-deps","sha":"a59ab5301ea45897c24e038e6be5ca6701e9475b","user":{"login":"igalic","id":497249,"avatar_url":"https://avatars.githubusercontent.com/u/497249?v=3","gravatar_id":"","url":"https://api.github.com/users/igalic","html_url":"https://github.com/igalic","followers_url":"https://api.github.com/users/igalic/followers","following_url":"https://api.github.com/users/igalic/following{/other_user}","gists_url":"https://api.github.com/users/igalic/gists{/gist_id}","starred_url":"https://api.github.com/users/igalic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igalic/subscriptions","organizations_url":"https://api.github.com/users/igalic/orgs","repos_url":"https://api.github.com/users/igalic/repos","events_url":"https://api.github.com/users/igalic/events{/privacy}","received_events_url":"https://api.github.com/users/igalic/received_events","type":"User","site_admin":false},"repo":{"id":62560671,"name":"puppet-kafka","full_name":"igalic/puppet-kafka","owner":{"login":"igalic","id":497249,"avatar_url":"https://avatars.githubusercontent.com/u/497249?v=3","gravatar_id":"","url":"https://api.github.com/users/igalic","html_url":"https://github.com/igalic","followers_url":"https://api.github.com/users/igalic/followers","following_url":"https://api.github.com/users/igalic/following{/other_user}","gists_url":"https://api.github.com/users/igalic/gists{/gist_id}","starred_url":"https://api.github.com/users/igalic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igalic/subscriptions","organizations_url":"https://api.github.com/users/igalic/orgs","repos_url":"https://api.github.com/users/igalic/repos","events_url":"https://api.github.com/users/igalic/events{/privacy}","received_events_url":"https://api.github.com/users/igalic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/igalic/puppet-kafka","description":"The kafka module for managing the installation and configuration of Apache Kafka","fork":true,"url":"https://api.github.com/repos/igalic/puppet-kafka","forks_url":"https://api.github.com/repos/igalic/puppet-kafka/forks","keys_url":"https://api.github.com/repos/igalic/puppet-kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/igalic/puppet-kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/igalic/puppet-kafka/teams","hooks_url":"https://api.github.com/repos/igalic/puppet-kafka/hooks","issue_events_url":"https://api.github.com/repos/igalic/puppet-kafka/issues/events{/number}","events_url":"https://api.github.com/repos/igalic/puppet-kafka/events","assignees_url":"https://api.github.com/repos/igalic/puppet-kafka/assignees{/user}","branches_url":"https://api.github.com/repos/igalic/puppet-kafka/branches{/branch}","tags_url":"https://api.github.com/repos/igalic/puppet-kafka/tags","blobs_url":"https://api.github.com/repos/igalic/puppet-kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/igalic/puppet-kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/igalic/puppet-kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/igalic/puppet-kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/igalic/puppet-kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/igalic/puppet-kafka/languages","stargazers_url":"https://api.github.com/repos/igalic/puppet-kafka/stargazers","contributors_url":"https://api.github.com/repos/igalic/puppet-kafka/contributors","subscribers_url":"https://api.github.com/repos/igalic/puppet-kafka/subscribers","subscription_url":"https://api.github.com/repos/igalic/puppet-kafka/subscription","commits_url":"https://api.github.com/repos/igalic/puppet-kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/igalic/puppet-kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/igalic/puppet-kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/igalic/puppet-kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/igalic/puppet-kafka/contents/{+path}","compare_url":"https://api.github.com/repos/igalic/puppet-kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/igalic/puppet-kafka/merges","archive_url":"https://api.github.com/repos/igalic/puppet-kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/igalic/puppet-kafka/downloads","issues_url":"https://api.github.com/repos/igalic/puppet-kafka/issues{/number}","pulls_url":"https://api.github.com/repos/igalic/puppet-kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/igalic/puppet-kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/igalic/puppet-kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/igalic/puppet-kafka/labels{/name}","releases_url":"https://api.github.com/repos/igalic/puppet-kafka/releases{/id}","deployments_url":"https://api.github.com/repos/igalic/puppet-kafka/deployments","created_at":"2016-07-04T12:32:02Z","updated_at":"2016-07-04T12:32:04Z","pushed_at":"2016-07-05T16:04:40Z","git_url":"git://github.com/igalic/puppet-kafka.git","ssh_url":"git@github.com:igalic/puppet-kafka.git","clone_url":"https://github.com/igalic/puppet-kafka.git","svn_url":"https://github.com/igalic/puppet-kafka","homepage":"https://forge.puppetlabs.com/puppet/kafka","size":282,"stargazers_count":0,"watchers_count":0,"language":"Puppet","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"voxpupuli:master","ref":"master","sha":"7af0c5033f32546ab034d9998339c26da8d39a90","user":{"login":"voxpupuli","id":8693967,"avatar_url":"https://avatars.githubusercontent.com/u/8693967?v=3","gravatar_id":"","url":"https://api.github.com/users/voxpupuli","html_url":"https://github.com/voxpupuli","followers_url":"https://api.github.com/users/voxpupuli/followers","following_url":"https://api.github.com/users/voxpupuli/following{/other_user}","gists_url":"https://api.github.com/users/voxpupuli/gists{/gist_id}","starred_url":"https://api.github.com/users/voxpupuli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voxpupuli/subscriptions","organizations_url":"https://api.github.com/users/voxpupuli/orgs","repos_url":"https://api.github.com/users/voxpupuli/repos","events_url":"https://api.github.com/users/voxpupuli/events{/privacy}","received_events_url":"https://api.github.com/users/voxpupuli/received_events","type":"Organization","site_admin":false},"repo":{"id":20067379,"name":"puppet-kafka","full_name":"voxpupuli/puppet-kafka","owner":{"login":"voxpupuli","id":8693967,"avatar_url":"https://avatars.githubusercontent.com/u/8693967?v=3","gravatar_id":"","url":"https://api.github.com/users/voxpupuli","html_url":"https://github.com/voxpupuli","followers_url":"https://api.github.com/users/voxpupuli/followers","following_url":"https://api.github.com/users/voxpupuli/following{/other_user}","gists_url":"https://api.github.com/users/voxpupuli/gists{/gist_id}","starred_url":"https://api.github.com/users/voxpupuli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voxpupuli/subscriptions","organizations_url":"https://api.github.com/users/voxpupuli/orgs","repos_url":"https://api.github.com/users/voxpupuli/repos","events_url":"https://api.github.com/users/voxpupuli/events{/privacy}","received_events_url":"https://api.github.com/users/voxpupuli/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/voxpupuli/puppet-kafka","description":"The kafka module for managing the installation and configuration of Apache Kafka","fork":false,"url":"https://api.github.com/repos/voxpupuli/puppet-kafka","forks_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/forks","keys_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/teams","hooks_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/hooks","issue_events_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/issues/events{/number}","events_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/events","assignees_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/assignees{/user}","branches_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/branches{/branch}","tags_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/tags","blobs_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/languages","stargazers_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/stargazers","contributors_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/contributors","subscribers_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/subscribers","subscription_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/subscription","commits_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/contents/{+path}","compare_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/merges","archive_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/downloads","issues_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/issues{/number}","pulls_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/labels{/name}","releases_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/releases{/id}","deployments_url":"https://api.github.com/repos/voxpupuli/puppet-kafka/deployments","created_at":"2014-05-22T15:57:31Z","updated_at":"2016-06-28T11:20:00Z","pushed_at":"2016-07-05T16:04:40Z","git_url":"git://github.com/voxpupuli/puppet-kafka.git","ssh_url":"git@github.com:voxpupuli/puppet-kafka.git","clone_url":"https://github.com/voxpupuli/puppet-kafka.git","svn_url":"https://github.com/voxpupuli/puppet-kafka","homepage":"https://forge.puppetlabs.com/puppet/kafka","size":313,"stargazers_count":17,"watchers_count":17,"language":"Puppet","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":13,"forks":48,"open_issues":13,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/82"},"html":{"href":"https://github.com/voxpupuli/puppet-kafka/pull/82"},"issue":{"href":"https://api.github.com/repos/voxpupuli/puppet-kafka/issues/82"},"comments":{"href":"https://api.github.com/repos/voxpupuli/puppet-kafka/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/voxpupuli/puppet-kafka/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/voxpupuli/puppet-kafka/statuses/a59ab5301ea45897c24e038e6be5ca6701e9475b"}}}}
{"actor":{"display_login":"igalic"}}