{"action":"created","comment":{"url":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/comments/90914917","pull_request_review_id":11428446,"id":90914917,"diff_hunk":"@@ -71,15 +71,36 @@ fi\n # Load the VERBOSE setting and other rcS variables\n . /lib/init/vars.sh\n \n+# Check to see if openHAB is currently running\n+EXISTINGPID=`pgrep java -G openhab | tail -1`\n+\n case \"$1\" in\n   start)\n         log_daemon_msg \"Starting $DESC\" \"$NAME\"\n-        #${OPENHAB_INST_DIR}/bin/setpermissions.sh > /dev/null\n-        if start-stop-daemon --start --quiet --pidfile $PIDFILE -c \"${USER_AND_GROUP}\" --umask 002 --background --make-pidfile --chdir ${OPENHAB_DIR} \\\n-                --oknodo --exec /usr/share/openhab2/runtime/bin/start\n+\n+        # If a process still exists but there's no PID file, then openHAB is probably still shutting down. We should proceed.\n+        if [ -z \"$EXISTINGPID\" ] || [ ! -f $PIDFILE ];\n         then\n-            log_end_msg 0\n+            if start-stop-daemon --start --quiet --pidfile $PIDFILE -c \"${USER_AND_GROUP}\" --umask 002 --background --chdir ${OPENHAB_DIR} \\","path":"resources/deb/etc/init.d/openhab2","position":18,"original_position":18,"commit_id":"4ae5bcabf5fe31c554f5152917675731dd571633","original_commit_id":"4ae5bcabf5fe31c554f5152917675731dd571633","user":{"login":"BClark09","id":8983584,"avatar_url":"https://avatars.githubusercontent.com/u/8983584?v=3","gravatar_id":"","url":"https://api.github.com/users/BClark09","html_url":"https://github.com/BClark09","followers_url":"https://api.github.com/users/BClark09/followers","following_url":"https://api.github.com/users/BClark09/following{/other_user}","gists_url":"https://api.github.com/users/BClark09/gists{/gist_id}","starred_url":"https://api.github.com/users/BClark09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BClark09/subscriptions","organizations_url":"https://api.github.com/users/BClark09/orgs","repos_url":"https://api.github.com/users/BClark09/repos","events_url":"https://api.github.com/users/BClark09/events{/privacy}","received_events_url":"https://api.github.com/users/BClark09/received_events","type":"User","site_admin":false},"body":"Ah, good idea. My only change of this line was to remove the --make-pidfile option. Since the line got shorter, it hadn't occured to me that the line was already too long to begin with!","created_at":"2016-12-05T17:33:15Z","updated_at":"2016-12-05T17:33:15Z","html_url":"https://github.com/openhab/openhab-linuxpkg/pull/6#discussion_r90914917","pull_request_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/comments/90914917"},"html":{"href":"https://github.com/openhab/openhab-linuxpkg/pull/6#discussion_r90914917"},"pull_request":{"href":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/6","id":96558922,"html_url":"https://github.com/openhab/openhab-linuxpkg/pull/6","diff_url":"https://github.com/openhab/openhab-linuxpkg/pull/6.diff","patch_url":"https://github.com/openhab/openhab-linuxpkg/pull/6.patch","issue_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/issues/6","number":6,"state":"open","locked":false,"title":"Updated and included init.d config","user":{"login":"BClark09","id":8983584,"avatar_url":"https://avatars.githubusercontent.com/u/8983584?v=3","gravatar_id":"","url":"https://api.github.com/users/BClark09","html_url":"https://github.com/BClark09","followers_url":"https://api.github.com/users/BClark09/followers","following_url":"https://api.github.com/users/BClark09/following{/other_user}","gists_url":"https://api.github.com/users/BClark09/gists{/gist_id}","starred_url":"https://api.github.com/users/BClark09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BClark09/subscriptions","organizations_url":"https://api.github.com/users/BClark09/orgs","repos_url":"https://api.github.com/users/BClark09/repos","events_url":"https://api.github.com/users/BClark09/events{/privacy}","received_events_url":"https://api.github.com/users/BClark09/received_events","type":"User","site_admin":false},"body":"Added init.d to the gradle build for Linux init systems based on sysVinit.\r\n\r\nAlso prevented more than one instance from running \"start\" multiple times and implemented a simple mechanism to keep /var/run/openhab.pid up to date. \r\n\r\nThis _should not_ affect Linux systems based on systemd.\r\n\r\nResolves https://github.com/openhab/openhab-distro/issues/328\r\n\r\nSigned-off-by: Ben Clark <ben@benjyc.uk>","created_at":"2016-12-05T16:14:47Z","updated_at":"2016-12-05T17:33:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"958bafdb149452ca509603751e660b489329e34f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/6/commits","review_comments_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/6/comments","review_comment_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/issues/6/comments","statuses_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/statuses/4ae5bcabf5fe31c554f5152917675731dd571633","head":{"label":"BClark09:pid-fix","ref":"pid-fix","sha":"4ae5bcabf5fe31c554f5152917675731dd571633","user":{"login":"BClark09","id":8983584,"avatar_url":"https://avatars.githubusercontent.com/u/8983584?v=3","gravatar_id":"","url":"https://api.github.com/users/BClark09","html_url":"https://github.com/BClark09","followers_url":"https://api.github.com/users/BClark09/followers","following_url":"https://api.github.com/users/BClark09/following{/other_user}","gists_url":"https://api.github.com/users/BClark09/gists{/gist_id}","starred_url":"https://api.github.com/users/BClark09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BClark09/subscriptions","organizations_url":"https://api.github.com/users/BClark09/orgs","repos_url":"https://api.github.com/users/BClark09/repos","events_url":"https://api.github.com/users/BClark09/events{/privacy}","received_events_url":"https://api.github.com/users/BClark09/received_events","type":"User","site_admin":false},"repo":{"id":75492813,"name":"openhab-linuxpkg","full_name":"BClark09/openhab-linuxpkg","owner":{"login":"BClark09","id":8983584,"avatar_url":"https://avatars.githubusercontent.com/u/8983584?v=3","gravatar_id":"","url":"https://api.github.com/users/BClark09","html_url":"https://github.com/BClark09","followers_url":"https://api.github.com/users/BClark09/followers","following_url":"https://api.github.com/users/BClark09/following{/other_user}","gists_url":"https://api.github.com/users/BClark09/gists{/gist_id}","starred_url":"https://api.github.com/users/BClark09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BClark09/subscriptions","organizations_url":"https://api.github.com/users/BClark09/orgs","repos_url":"https://api.github.com/users/BClark09/repos","events_url":"https://api.github.com/users/BClark09/events{/privacy}","received_events_url":"https://api.github.com/users/BClark09/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BClark09/openhab-linuxpkg","description":"Repo for Linux packages","fork":true,"url":"https://api.github.com/repos/BClark09/openhab-linuxpkg","forks_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/forks","keys_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/teams","hooks_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/hooks","issue_events_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/issues/events{/number}","events_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/events","assignees_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/assignees{/user}","branches_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/branches{/branch}","tags_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/tags","blobs_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/git/refs{/sha}","trees_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/statuses/{sha}","languages_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/languages","stargazers_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/stargazers","contributors_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/contributors","subscribers_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/subscribers","subscription_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/subscription","commits_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/commits{/sha}","git_commits_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/git/commits{/sha}","comments_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/comments{/number}","issue_comment_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/issues/comments{/number}","contents_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/contents/{+path}","compare_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/merges","archive_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/downloads","issues_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/issues{/number}","pulls_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/pulls{/number}","milestones_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/milestones{/number}","notifications_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/labels{/name}","releases_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/releases{/id}","deployments_url":"https://api.github.com/repos/BClark09/openhab-linuxpkg/deployments","created_at":"2016-12-03T18:35:46Z","updated_at":"2016-12-03T18:35:47Z","pushed_at":"2016-12-05T10:22:56Z","git_url":"git://github.com/BClark09/openhab-linuxpkg.git","ssh_url":"git@github.com:BClark09/openhab-linuxpkg.git","clone_url":"https://github.com/BClark09/openhab-linuxpkg.git","svn_url":"https://github.com/BClark09/openhab-linuxpkg","homepage":null,"size":71,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"openhab:master","ref":"master","sha":"f59221d6de550648bff8a89edb8d185ca6a66b9d","user":{"login":"openhab","id":1007353,"avatar_url":"https://avatars.githubusercontent.com/u/1007353?v=3","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"repo":{"id":71291775,"name":"openhab-linuxpkg","full_name":"openhab/openhab-linuxpkg","owner":{"login":"openhab","id":1007353,"avatar_url":"https://avatars.githubusercontent.com/u/1007353?v=3","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openhab/openhab-linuxpkg","description":"Repo for Linux packages","fork":false,"url":"https://api.github.com/repos/openhab/openhab-linuxpkg","forks_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/forks","keys_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/teams","hooks_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/hooks","issue_events_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/issues/events{/number}","events_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/events","assignees_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/assignees{/user}","branches_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/branches{/branch}","tags_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/tags","blobs_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/git/refs{/sha}","trees_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/statuses/{sha}","languages_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/languages","stargazers_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/stargazers","contributors_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/contributors","subscribers_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/subscribers","subscription_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/subscription","commits_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/commits{/sha}","git_commits_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/git/commits{/sha}","comments_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/comments{/number}","issue_comment_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/issues/comments{/number}","contents_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/contents/{+path}","compare_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/merges","archive_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/downloads","issues_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/issues{/number}","pulls_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls{/number}","milestones_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/milestones{/number}","notifications_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/labels{/name}","releases_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/releases{/id}","deployments_url":"https://api.github.com/repos/openhab/openhab-linuxpkg/deployments","created_at":"2016-10-18T21:12:58Z","updated_at":"2016-12-03T09:20:29Z","pushed_at":"2016-12-05T16:14:47Z","git_url":"git://github.com/openhab/openhab-linuxpkg.git","ssh_url":"git@github.com:openhab/openhab-linuxpkg.git","clone_url":"https://github.com/openhab/openhab-linuxpkg.git","svn_url":"https://github.com/openhab/openhab-linuxpkg","homepage":null,"size":90,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/6"},"html":{"href":"https://github.com/openhab/openhab-linuxpkg/pull/6"},"issue":{"href":"https://api.github.com/repos/openhab/openhab-linuxpkg/issues/6"},"comments":{"href":"https://api.github.com/repos/openhab/openhab-linuxpkg/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openhab/openhab-linuxpkg/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/openhab/openhab-linuxpkg/statuses/4ae5bcabf5fe31c554f5152917675731dd571633"}}}}
{"actor":{"display_login":"BClark09"}}