{"action":"created","comment":{"url":"https://api.github.com/repos/sysstat/sysstat/pulls/comments/27752769","id":27752769,"diff_hunk":"@@ -2,20 +2,27 @@\n # (C) 2012 Peter Schiffer (pschiffe <at> redhat.com)\n #\n # @PACKAGE_NAME@-@PACKAGE_VERSION@ systemd unit file:\n-#\t Insert a dummy record in current daily data file.\n-#\t This indicates that the counters have restarted from 0.\n+#     1. Insert a dummy record in current daily data file when starting/stopping\n+#        the unit. This indicates that the counters have restarted from 0.\n+#     2. This unit is automatically stopped/started on suspend/resume,\n+#        see /usr/lib/systemd/system-sleep/sysstat-sleep.sh.\n+#     3. Starting this unit also starts the timer unit for periodic accounting.\n \n [Unit]\n-Description=Resets System Activity Logs\n+Description=System Activity Accounting\n+# Start the periodic accounting process\n+Requires=sysstat-collect.timer\n+# but make sure we finish first, because the accounting process locks the datafile\n+Before=sysstat-collect.timer sysstat-collect.service\n \n [Service]\n Type=oneshot\n RemainAfterExit=yes\n User=@CRON_OWNER@\n-ExecStart=@SA_LIB_DIR@/sa1 --boot\n+ExecStart=@SA_LIB_DIR@/sa1 --boot -C STARTED","path":"sysstat.service.in","position":25,"original_position":25,"commit_id":"5c6f4583b4521f512928585129d23f6c4f1e2609","original_commit_id":"5c6f4583b4521f512928585129d23f6c4f1e2609","user":{"login":"jimis","id":3584514,"avatar_url":"https://avatars.githubusercontent.com/u/3584514?v=3","gravatar_id":"","url":"https://api.github.com/users/jimis","html_url":"https://github.com/jimis","followers_url":"https://api.github.com/users/jimis/followers","following_url":"https://api.github.com/users/jimis/following{/other_user}","gists_url":"https://api.github.com/users/jimis/gists{/gist_id}","starred_url":"https://api.github.com/users/jimis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimis/subscriptions","organizations_url":"https://api.github.com/users/jimis/orgs","repos_url":"https://api.github.com/users/jimis/repos","events_url":"https://api.github.com/users/jimis/events{/privacy}","received_events_url":"https://api.github.com/users/jimis/received_events","type":"User","site_admin":false},"body":"Hmm it was on purpose that I removed the \"LINUX-RESTART\" line, since I thought it was only serving as a comment, and that it didn't affect functionality. So I replaced a comment with a more accurate one, since resuming is not really a \"linux-restart\". FYI having a comment at the suspend-resume and shutdown-restart points, helps when you are plotting the data, to insert a gap in the graph.\r\n\r\nWhen you say the LINUX-RESTART line resets the counters, how does this affect sysstat's functionality, and which components of sysstat?\r\n\r\nI'm thinking that if it changes the logging behaviour, then I can't put that command back because it will cause the counter-reset on every resume. Which means that I'll have to think another way of writing this record on suspend/resume.","created_at":"2015-04-03T20:15:10Z","updated_at":"2015-04-03T20:15:10Z","html_url":"https://github.com/sysstat/sysstat/pull/61#discussion_r27752769","pull_request_url":"https://api.github.com/repos/sysstat/sysstat/pulls/61","_links":{"self":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/comments/27752769"},"html":{"href":"https://github.com/sysstat/sysstat/pull/61#discussion_r27752769"},"pull_request":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/61"}}},"pull_request":{"url":"https://api.github.com/repos/sysstat/sysstat/pulls/61","id":32565871,"html_url":"https://github.com/sysstat/sysstat/pull/61","diff_url":"https://github.com/sysstat/sysstat/pull/61.diff","patch_url":"https://github.com/sysstat/sysstat/pull/61.patch","issue_url":"https://api.github.com/repos/sysstat/sysstat/issues/61","number":61,"state":"open","locked":false,"title":"Refactor systemd unit files to better work with suspend/resume","user":{"login":"jimis","id":3584514,"avatar_url":"https://avatars.githubusercontent.com/u/3584514?v=3","gravatar_id":"","url":"https://api.github.com/users/jimis","html_url":"https://github.com/jimis","followers_url":"https://api.github.com/users/jimis/followers","following_url":"https://api.github.com/users/jimis/following{/other_user}","gists_url":"https://api.github.com/users/jimis/gists{/gist_id}","starred_url":"https://api.github.com/users/jimis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimis/subscriptions","organizations_url":"https://api.github.com/users/jimis/orgs","repos_url":"https://api.github.com/users/jimis/repos","events_url":"https://api.github.com/users/jimis/events{/privacy}","received_events_url":"https://api.github.com/users/jimis/received_events","type":"User","site_admin":false},"body":"Previously a comment was written to the accounting log only on system boot,\r\nwhich caused artifacts in generated graphs of laptops with suspend/resume\r\nfunctionality. The solution is to write a similar comment both before suspend\r\nand after resume, so that the graphing program can insert a gap in that\r\ntimeframe.\r\n\r\nAs a nice side-effect, one can now start sysstat just by doing\r\n\"systemctl start sysstat\", and the timer unit will be pulled automatically\r\nin the proper order, so that there is no contention for locking\r\nthe accounting file. Same goes for stopping.","created_at":"2015-04-03T02:13:55Z","updated_at":"2015-04-03T20:15:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c07015a1995176f963e4680b863bc500c2f7cb6c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sysstat/sysstat/pulls/61/commits","review_comments_url":"https://api.github.com/repos/sysstat/sysstat/pulls/61/comments","review_comment_url":"https://api.github.com/repos/sysstat/sysstat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sysstat/sysstat/issues/61/comments","statuses_url":"https://api.github.com/repos/sysstat/sysstat/statuses/5c6f4583b4521f512928585129d23f6c4f1e2609","head":{"label":"jimis:systemd_suspend_resume","ref":"systemd_suspend_resume","sha":"5c6f4583b4521f512928585129d23f6c4f1e2609","user":{"login":"jimis","id":3584514,"avatar_url":"https://avatars.githubusercontent.com/u/3584514?v=3","gravatar_id":"","url":"https://api.github.com/users/jimis","html_url":"https://github.com/jimis","followers_url":"https://api.github.com/users/jimis/followers","following_url":"https://api.github.com/users/jimis/following{/other_user}","gists_url":"https://api.github.com/users/jimis/gists{/gist_id}","starred_url":"https://api.github.com/users/jimis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimis/subscriptions","organizations_url":"https://api.github.com/users/jimis/orgs","repos_url":"https://api.github.com/users/jimis/repos","events_url":"https://api.github.com/users/jimis/events{/privacy}","received_events_url":"https://api.github.com/users/jimis/received_events","type":"User","site_admin":false},"repo":{"id":18895785,"name":"sysstat","full_name":"jimis/sysstat","owner":{"login":"jimis","id":3584514,"avatar_url":"https://avatars.githubusercontent.com/u/3584514?v=3","gravatar_id":"","url":"https://api.github.com/users/jimis","html_url":"https://github.com/jimis","followers_url":"https://api.github.com/users/jimis/followers","following_url":"https://api.github.com/users/jimis/following{/other_user}","gists_url":"https://api.github.com/users/jimis/gists{/gist_id}","starred_url":"https://api.github.com/users/jimis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimis/subscriptions","organizations_url":"https://api.github.com/users/jimis/orgs","repos_url":"https://api.github.com/users/jimis/repos","events_url":"https://api.github.com/users/jimis/events{/privacy}","received_events_url":"https://api.github.com/users/jimis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jimis/sysstat","description":"Public repository for the Linux sysstat tools.","fork":true,"url":"https://api.github.com/repos/jimis/sysstat","forks_url":"https://api.github.com/repos/jimis/sysstat/forks","keys_url":"https://api.github.com/repos/jimis/sysstat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jimis/sysstat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jimis/sysstat/teams","hooks_url":"https://api.github.com/repos/jimis/sysstat/hooks","issue_events_url":"https://api.github.com/repos/jimis/sysstat/issues/events{/number}","events_url":"https://api.github.com/repos/jimis/sysstat/events","assignees_url":"https://api.github.com/repos/jimis/sysstat/assignees{/user}","branches_url":"https://api.github.com/repos/jimis/sysstat/branches{/branch}","tags_url":"https://api.github.com/repos/jimis/sysstat/tags","blobs_url":"https://api.github.com/repos/jimis/sysstat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jimis/sysstat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jimis/sysstat/git/refs{/sha}","trees_url":"https://api.github.com/repos/jimis/sysstat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jimis/sysstat/statuses/{sha}","languages_url":"https://api.github.com/repos/jimis/sysstat/languages","stargazers_url":"https://api.github.com/repos/jimis/sysstat/stargazers","contributors_url":"https://api.github.com/repos/jimis/sysstat/contributors","subscribers_url":"https://api.github.com/repos/jimis/sysstat/subscribers","subscription_url":"https://api.github.com/repos/jimis/sysstat/subscription","commits_url":"https://api.github.com/repos/jimis/sysstat/commits{/sha}","git_commits_url":"https://api.github.com/repos/jimis/sysstat/git/commits{/sha}","comments_url":"https://api.github.com/repos/jimis/sysstat/comments{/number}","issue_comment_url":"https://api.github.com/repos/jimis/sysstat/issues/comments{/number}","contents_url":"https://api.github.com/repos/jimis/sysstat/contents/{+path}","compare_url":"https://api.github.com/repos/jimis/sysstat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jimis/sysstat/merges","archive_url":"https://api.github.com/repos/jimis/sysstat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jimis/sysstat/downloads","issues_url":"https://api.github.com/repos/jimis/sysstat/issues{/number}","pulls_url":"https://api.github.com/repos/jimis/sysstat/pulls{/number}","milestones_url":"https://api.github.com/repos/jimis/sysstat/milestones{/number}","notifications_url":"https://api.github.com/repos/jimis/sysstat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jimis/sysstat/labels{/name}","releases_url":"https://api.github.com/repos/jimis/sysstat/releases{/id}","created_at":"2014-04-17T22:46:42Z","updated_at":"2015-04-01T00:42:53Z","pushed_at":"2015-04-03T19:58:00Z","git_url":"git://github.com/jimis/sysstat.git","ssh_url":"git@github.com:jimis/sysstat.git","clone_url":"https://github.com/jimis/sysstat.git","svn_url":"https://github.com/jimis/sysstat","homepage":null,"size":2391,"stargazers_count":0,"watchers_count":0,"language":"C","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":"sysstat:master","ref":"master","sha":"8b4073ed66cc9da973aaee575fd27a1e1eec7e64","user":{"login":"sysstat","id":4254780,"avatar_url":"https://avatars.githubusercontent.com/u/4254780?v=3","gravatar_id":"","url":"https://api.github.com/users/sysstat","html_url":"https://github.com/sysstat","followers_url":"https://api.github.com/users/sysstat/followers","following_url":"https://api.github.com/users/sysstat/following{/other_user}","gists_url":"https://api.github.com/users/sysstat/gists{/gist_id}","starred_url":"https://api.github.com/users/sysstat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sysstat/subscriptions","organizations_url":"https://api.github.com/users/sysstat/orgs","repos_url":"https://api.github.com/users/sysstat/repos","events_url":"https://api.github.com/users/sysstat/events{/privacy}","received_events_url":"https://api.github.com/users/sysstat/received_events","type":"User","site_admin":false},"repo":{"id":9670198,"name":"sysstat","full_name":"sysstat/sysstat","owner":{"login":"sysstat","id":4254780,"avatar_url":"https://avatars.githubusercontent.com/u/4254780?v=3","gravatar_id":"","url":"https://api.github.com/users/sysstat","html_url":"https://github.com/sysstat","followers_url":"https://api.github.com/users/sysstat/followers","following_url":"https://api.github.com/users/sysstat/following{/other_user}","gists_url":"https://api.github.com/users/sysstat/gists{/gist_id}","starred_url":"https://api.github.com/users/sysstat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sysstat/subscriptions","organizations_url":"https://api.github.com/users/sysstat/orgs","repos_url":"https://api.github.com/users/sysstat/repos","events_url":"https://api.github.com/users/sysstat/events{/privacy}","received_events_url":"https://api.github.com/users/sysstat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sysstat/sysstat","description":"Performance monitoring tools for Linux","fork":false,"url":"https://api.github.com/repos/sysstat/sysstat","forks_url":"https://api.github.com/repos/sysstat/sysstat/forks","keys_url":"https://api.github.com/repos/sysstat/sysstat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sysstat/sysstat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sysstat/sysstat/teams","hooks_url":"https://api.github.com/repos/sysstat/sysstat/hooks","issue_events_url":"https://api.github.com/repos/sysstat/sysstat/issues/events{/number}","events_url":"https://api.github.com/repos/sysstat/sysstat/events","assignees_url":"https://api.github.com/repos/sysstat/sysstat/assignees{/user}","branches_url":"https://api.github.com/repos/sysstat/sysstat/branches{/branch}","tags_url":"https://api.github.com/repos/sysstat/sysstat/tags","blobs_url":"https://api.github.com/repos/sysstat/sysstat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sysstat/sysstat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sysstat/sysstat/git/refs{/sha}","trees_url":"https://api.github.com/repos/sysstat/sysstat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sysstat/sysstat/statuses/{sha}","languages_url":"https://api.github.com/repos/sysstat/sysstat/languages","stargazers_url":"https://api.github.com/repos/sysstat/sysstat/stargazers","contributors_url":"https://api.github.com/repos/sysstat/sysstat/contributors","subscribers_url":"https://api.github.com/repos/sysstat/sysstat/subscribers","subscription_url":"https://api.github.com/repos/sysstat/sysstat/subscription","commits_url":"https://api.github.com/repos/sysstat/sysstat/commits{/sha}","git_commits_url":"https://api.github.com/repos/sysstat/sysstat/git/commits{/sha}","comments_url":"https://api.github.com/repos/sysstat/sysstat/comments{/number}","issue_comment_url":"https://api.github.com/repos/sysstat/sysstat/issues/comments{/number}","contents_url":"https://api.github.com/repos/sysstat/sysstat/contents/{+path}","compare_url":"https://api.github.com/repos/sysstat/sysstat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sysstat/sysstat/merges","archive_url":"https://api.github.com/repos/sysstat/sysstat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sysstat/sysstat/downloads","issues_url":"https://api.github.com/repos/sysstat/sysstat/issues{/number}","pulls_url":"https://api.github.com/repos/sysstat/sysstat/pulls{/number}","milestones_url":"https://api.github.com/repos/sysstat/sysstat/milestones{/number}","notifications_url":"https://api.github.com/repos/sysstat/sysstat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sysstat/sysstat/labels{/name}","releases_url":"https://api.github.com/repos/sysstat/sysstat/releases{/id}","created_at":"2013-04-25T11:23:10Z","updated_at":"2015-04-03T09:11:17Z","pushed_at":"2015-04-03T19:59:07Z","git_url":"git://github.com/sysstat/sysstat.git","ssh_url":"git@github.com:sysstat/sysstat.git","clone_url":"https://github.com/sysstat/sysstat.git","svn_url":"https://github.com/sysstat/sysstat","homepage":"http://sebastien.godard.pagesperso-orange.fr/","size":3479,"stargazers_count":161,"watchers_count":161,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":9,"forks":46,"open_issues":9,"watchers":161,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/61"},"html":{"href":"https://github.com/sysstat/sysstat/pull/61"},"issue":{"href":"https://api.github.com/repos/sysstat/sysstat/issues/61"},"comments":{"href":"https://api.github.com/repos/sysstat/sysstat/issues/61/comments"},"review_comments":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/61/comments"},"review_comment":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sysstat/sysstat/pulls/61/commits"},"statuses":{"href":"https://api.github.com/repos/sysstat/sysstat/statuses/5c6f4583b4521f512928585129d23f6c4f1e2609"}}}}