{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/4239","repository_url":"https://api.github.com/repos/systemd/systemd","labels_url":"https://api.github.com/repos/systemd/systemd/issues/4239/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/4239/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/4239/events","html_url":"https://github.com/systemd/systemd/issues/4239","id":180006644,"number":4239,"title":"RFE: Track service config files","user":{"login":"purpleidea","id":135091,"avatar_url":"https://avatars.githubusercontent.com/u/135091?v=3","gravatar_id":"","url":"https://api.github.com/users/purpleidea","html_url":"https://github.com/purpleidea","followers_url":"https://api.github.com/users/purpleidea/followers","following_url":"https://api.github.com/users/purpleidea/following{/other_user}","gists_url":"https://api.github.com/users/purpleidea/gists{/gist_id}","starred_url":"https://api.github.com/users/purpleidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purpleidea/subscriptions","organizations_url":"https://api.github.com/users/purpleidea/orgs","repos_url":"https://api.github.com/users/purpleidea/repos","events_url":"https://api.github.com/users/purpleidea/events{/privacy}","received_events_url":"https://api.github.com/users/purpleidea/received_events","type":"User","site_admin":false},"labels":[{"id":221925707,"url":"https://api.github.com/repos/systemd/systemd/labels/pid1","name":"pid1","color":"c7def8","default":false},{"id":191919608,"url":"https://api.github.com/repos/systemd/systemd/labels/RFE","name":"RFE","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":29,"created_at":"2016-09-29T10:07:19Z","updated_at":"2016-11-03T09:04:11Z","closed_at":null,"body":"### Submission type\n- [ ] Bug report\n- [X] Request for enhancement (RFE)\n\nThis is an RFE to extend systemd and the unit file (slightly) to improve the experience for the config management and automation communities.\n### Proposal\n\n1.) Add a field in the service unit file to declaratively list the config files which the service depends on. This could look something like the following:\n\n```\n[Config]\nConfigFile=/etc/foo.conf\nConfigDir=/etc/foo.d/\nConfigMatch=/etc/foo/*.conf\n```\n\nYou can specify as many of these directives as you'd like. I recommend being able to glob to match simple patterns. These could also all be mixed together under a single directive (eg: `ConfigPath`) if that is decided to be more aesthetically pleasing.\n\nLennart had mentioned that he would like these to be relative paths, and the absolute prefix (eg: /etc/) be passed in by systemd. This variant doesn't negatively impact this proposal in any way and is up to the systemd core team on which they prefer.\n\n2.) Provide an API to specifically get the last reloaded time of the service in particular. Currently it's possible to get `ExecMainStartTimestamp`, but not `ExecMainReloadTimestamp`. This would be an easy addition to the API.\n### Advantage to user\n\nBy combining these two concepts, the `systemctl status` command could tell a user if the last modified time of any of the listed config files is newer than the last modified time of reload and start. If so it's likely that the service needs a reload to be able to use the newest version of the configs and be running in the correct state as seen on disk.\n### Advantage to config management communities\n\n1.) Currently there's no guaranteed way to detect if a currently running service is in the correct state with respect to the configuration files specified. In particular, if the automation technology updates a configuration file, it will typically then run a reload of the service. However if an error occurs after the file update but before the reload, on a subsequent run, you will loose the information that the service needs reloading!\n\n2.) With the config file information listed in the service unit file, it will be easy for config management tools to automatically know the dependency relationship between the config file and the service. This means they can know to update the config file before starting or reloading the service. This would make everyone's life easier.\n### Getting these additions into distribution unit files.\n\nSince this would benefit the sysadmin and devops consumers greatly, and since these types of patches are quite easy to write, even non-programmers using these services will be able to send distribution and upstream patches to add these options. If they are not added, it doesn't hurt the status-quo.\n### More information\n\nI'll be presenting this information during my talk at [systemd conf](https://cfp.systemd.io/en/systemdconf_2016/public/events/1), during my [`mgmt`](https://github.com/purpleidea/mgmt/) presentation. I will post the video link once it is available.\n\nThank you for your consideration!\n"},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/258091378","html_url":"https://github.com/systemd/systemd/issues/4239#issuecomment-258091378","issue_url":"https://api.github.com/repos/systemd/systemd/issues/4239","id":258091378,"user":{"login":"pspacek","id":11509590,"avatar_url":"https://avatars.githubusercontent.com/u/11509590?v=3","gravatar_id":"","url":"https://api.github.com/users/pspacek","html_url":"https://github.com/pspacek","followers_url":"https://api.github.com/users/pspacek/followers","following_url":"https://api.github.com/users/pspacek/following{/other_user}","gists_url":"https://api.github.com/users/pspacek/gists{/gist_id}","starred_url":"https://api.github.com/users/pspacek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pspacek/subscriptions","organizations_url":"https://api.github.com/users/pspacek/orgs","repos_url":"https://api.github.com/users/pspacek/repos","events_url":"https://api.github.com/users/pspacek/events{/privacy}","received_events_url":"https://api.github.com/users/pspacek/received_events","type":"User","site_admin":false},"created_at":"2016-11-03T09:04:11Z","updated_at":"2016-11-03T09:04:11Z","body":"Side-note: Tracking all configuration files which are significant for particular program/service gets interesting. E.g. programs using NSS library might need to list /etc/nsswitch.conf or /etc/resolv.conf - similarly to any other configuration file used by a library called by the main program..."}}
{"actor":{"display_login":"pspacek"}}