{"action":"created","comment":{"url":"https://api.github.com/repos/keybase/client/pulls/comments/148846487","pull_request_review_id":74156713,"id":148846487,"diff_hunk":"@@ -9,8 +9,13 @@ import (\n \n \tsdActivation \"github.com/coreos/go-systemd/activation\"\n \tsdDaemon \"github.com/coreos/go-systemd/daemon\"\n+\tsdUtil \"github.com/coreos/go-systemd/util\"\n )\n \n+func IsRunningSystemd() bool {\n+\treturn sdUtil.IsRunningSystemd()","path":"go/systemd/systemd_linux.go","position":8,"original_position":8,"commit_id":"9ffd41cb04c8d8d18d2c1903bd59a990e3b073b1","original_commit_id":"9ffd41cb04c8d8d18d2c1903bd59a990e3b073b1","user":{"login":"oconnor663","id":860932,"avatar_url":"https://avatars0.githubusercontent.com/u/860932?v=4","gravatar_id":"","url":"https://api.github.com/users/oconnor663","html_url":"https://github.com/oconnor663","followers_url":"https://api.github.com/users/oconnor663/followers","following_url":"https://api.github.com/users/oconnor663/following{/other_user}","gists_url":"https://api.github.com/users/oconnor663/gists{/gist_id}","starred_url":"https://api.github.com/users/oconnor663/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oconnor663/subscriptions","organizations_url":"https://api.github.com/users/oconnor663/orgs","repos_url":"https://api.github.com/users/oconnor663/repos","events_url":"https://api.github.com/users/oconnor663/events{/privacy}","received_events_url":"https://api.github.com/users/oconnor663/received_events","type":"User","site_admin":false},"body":"This ends up just making a [simple stat call](https://github.com/coreos/go-systemd/blob/master/util/util.go#L72-L78):\r\n\r\n```go\r\nfunc IsRunningSystemd() bool {\r\n\tfi, err := os.Lstat(\"/run/systemd/system\")\r\n\tif err != nil {\r\n\t\treturn false\r\n\t}\r\n\treturn fi.IsDir()\r\n}\r\n```","created_at":"2017-11-03T17:29:29Z","updated_at":"2017-11-03T17:29:29Z","html_url":"https://github.com/keybase/client/pull/9373#discussion_r148846487","pull_request_url":"https://api.github.com/repos/keybase/client/pulls/9373","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/comments/148846487"},"html":{"href":"https://github.com/keybase/client/pull/9373#discussion_r148846487"},"pull_request":{"href":"https://api.github.com/repos/keybase/client/pulls/9373"}},"in_reply_to_id":148842650},"pull_request":{"url":"https://api.github.com/repos/keybase/client/pulls/9373","id":150582698,"html_url":"https://github.com/keybase/client/pull/9373","diff_url":"https://github.com/keybase/client/pull/9373.diff","patch_url":"https://github.com/keybase/client/pull/9373.patch","issue_url":"https://api.github.com/repos/keybase/client/issues/9373","number":9373,"state":"open","locked":false,"title":"make `keybase ctl` talk to systemd","user":{"login":"oconnor663","id":860932,"avatar_url":"https://avatars0.githubusercontent.com/u/860932?v=4","gravatar_id":"","url":"https://api.github.com/users/oconnor663","html_url":"https://github.com/oconnor663","followers_url":"https://api.github.com/users/oconnor663/followers","following_url":"https://api.github.com/users/oconnor663/following{/other_user}","gists_url":"https://api.github.com/users/oconnor663/gists{/gist_id}","starred_url":"https://api.github.com/users/oconnor663/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oconnor663/subscriptions","organizations_url":"https://api.github.com/users/oconnor663/orgs","repos_url":"https://api.github.com/users/oconnor663/repos","events_url":"https://api.github.com/users/oconnor663/events{/privacy}","received_events_url":"https://api.github.com/users/oconnor663/received_events","type":"User","site_admin":false},"body":"The change here ends up being fairly small. Here's the story:\r\n\r\n- Autoforking logic now checks to see if systemd is running, using a\r\n  utility function from the CoreOS library, and if so it starts\r\n  keybase.service instead of forking. This is the main logic change.\r\n- `keybase ctl start` does nothing but autofork, so it just works.\r\n- `keybase ctl stop` already sends an RPC that makes the service exit\r\n  cleanly, and the keybase.service unit file won't restart it in that\r\n  case (Restart=on-failure), so that also just works.\r\n- `keybase ctl restart` does a stop and then waits 2 seconds, which also\r\n  just works. In a perfect world we might wait on locking the pidfile\r\n  instead, but we don't need to change this now.\r\n\r\nr? @maxtaco ","created_at":"2017-11-03T17:11:49Z","updated_at":"2017-11-03T17:29:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc4ceb425a517c4281c6610f1e304a0fb89a05ae","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/keybase/client/pulls/9373/commits","review_comments_url":"https://api.github.com/repos/keybase/client/pulls/9373/comments","review_comment_url":"https://api.github.com/repos/keybase/client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keybase/client/issues/9373/comments","statuses_url":"https://api.github.com/repos/keybase/client/statuses/9ffd41cb04c8d8d18d2c1903bd59a990e3b073b1","head":{"label":"keybase:jack/CORE-6468/systemd-autofork","ref":"jack/CORE-6468/systemd-autofork","sha":"9ffd41cb04c8d8d18d2c1903bd59a990e3b073b1","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","deployments_url":"https://api.github.com/repos/keybase/client/deployments","created_at":"2015-01-11T17:17:12Z","updated_at":"2017-11-03T17:22:31Z","pushed_at":"2017-11-03T17:23:13Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":209853,"stargazers_count":2733,"watchers_count":2733,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":246,"mirror_url":null,"archived":false,"open_issues_count":1564,"forks":246,"open_issues":1564,"watchers":2733,"default_branch":"master"}},"base":{"label":"keybase:master","ref":"master","sha":"ec781214bbc3a52b3da7aefbc65e70db7ab2cc50","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars2.githubusercontent.com/u/5400834?v=4","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","deployments_url":"https://api.github.com/repos/keybase/client/deployments","created_at":"2015-01-11T17:17:12Z","updated_at":"2017-11-03T17:22:31Z","pushed_at":"2017-11-03T17:23:13Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":209853,"stargazers_count":2733,"watchers_count":2733,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":246,"mirror_url":null,"archived":false,"open_issues_count":1564,"forks":246,"open_issues":1564,"watchers":2733,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/9373"},"html":{"href":"https://github.com/keybase/client/pull/9373"},"issue":{"href":"https://api.github.com/repos/keybase/client/issues/9373"},"comments":{"href":"https://api.github.com/repos/keybase/client/issues/9373/comments"},"review_comments":{"href":"https://api.github.com/repos/keybase/client/pulls/9373/comments"},"review_comment":{"href":"https://api.github.com/repos/keybase/client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keybase/client/pulls/9373/commits"},"statuses":{"href":"https://api.github.com/repos/keybase/client/statuses/9ffd41cb04c8d8d18d2c1903bd59a990e3b073b1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"oconnor663"}}