{"action":"created","issue":{"url":"https://api.github.com/repos/gentoo/porticron/issues/5","labels_url":"https://api.github.com/repos/gentoo/porticron/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/gentoo/porticron/issues/5/comments","events_url":"https://api.github.com/repos/gentoo/porticron/issues/5/events","html_url":"https://github.com/gentoo/porticron/issues/5","id":95698625,"number":5,"title":"Include systemd units","user":{"login":"GreatEmerald","id":726893,"avatar_url":"https://avatars.githubusercontent.com/u/726893?v=3","gravatar_id":"","url":"https://api.github.com/users/GreatEmerald","html_url":"https://github.com/GreatEmerald","followers_url":"https://api.github.com/users/GreatEmerald/followers","following_url":"https://api.github.com/users/GreatEmerald/following{/other_user}","gists_url":"https://api.github.com/users/GreatEmerald/gists{/gist_id}","starred_url":"https://api.github.com/users/GreatEmerald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GreatEmerald/subscriptions","organizations_url":"https://api.github.com/users/GreatEmerald/orgs","repos_url":"https://api.github.com/users/GreatEmerald/repos","events_url":"https://api.github.com/users/GreatEmerald/events{/privacy}","received_events_url":"https://api.github.com/users/GreatEmerald/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-17T16:57:19Z","updated_at":"2015-07-17T18:43:47Z","closed_at":null,"body":"Given the nature of the tool, it would be nice if it included systemd units as well for automated running on every boot/day.\r\n\r\nSince I'm not entirely certain about each line, and the units are trivial, I'll just inline the ones I use right now here instead of making a pull request.\r\n`porticron.service`:\r\n```ini\r\n[Unit]\r\nDescription=Porticron\r\nAfter=network-online.target\r\nWants=network-online.target\r\n\r\n[Service]\r\nType=oneshot\r\nExecStart=/usr/sbin/porticron -v\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n```\r\n\r\n`porticron.timer`:\r\n```ini\r\n[Unit]\r\nDescription=Scheduled Porticron\r\nAfter=network-online.target\r\nWants=network-online.target\r\n\r\n[Timer]\r\nPersistent=true\r\nOnCalendar=daily\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n```\r\nTwo things I'm not entirely certain about are whether or not the `.service` file in `[Service]` should have `RemainAfterExit=yes` or not; and whether the `After` and `Wants` need to be specified for both units. Also the descriptions might need to be changed."},"comment":{"url":"https://api.github.com/repos/gentoo/porticron/issues/comments/122370614","html_url":"https://github.com/gentoo/porticron/issues/5#issuecomment-122370614","issue_url":"https://api.github.com/repos/gentoo/porticron/issues/5","id":122370614,"user":{"login":"rich0","id":1095829,"avatar_url":"https://avatars.githubusercontent.com/u/1095829?v=3","gravatar_id":"","url":"https://api.github.com/users/rich0","html_url":"https://github.com/rich0","followers_url":"https://api.github.com/users/rich0/followers","following_url":"https://api.github.com/users/rich0/following{/other_user}","gists_url":"https://api.github.com/users/rich0/gists{/gist_id}","starred_url":"https://api.github.com/users/rich0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rich0/subscriptions","organizations_url":"https://api.github.com/users/rich0/orgs","repos_url":"https://api.github.com/users/rich0/repos","events_url":"https://api.github.com/users/rich0/events{/privacy}","received_events_url":"https://api.github.com/users/rich0/received_events","type":"User","site_admin":false},"created_at":"2015-07-17T18:43:47Z","updated_at":"2015-07-17T18:43:47Z","body":"I would NOT set RemainAfterExit=yes otherwise I believe it won't start each day since as far as systemd is concerned it is still running from the previous start.\r\n\r\nYou should use ExecStart and not ExecStartPost.  I don't think you can even have a service without an ExecStart.  The service is running when emerge is syncing, and it is stopped when it isn't.   You want it to run once a day.  \r\n\r\nFinally, you need to add a line to your timer unit:\r\n[Timer]\r\nUnit=porticron.service\r\n\r\nThat tells the timer what unit to start when it triggers."}}