| Summary: | app-admin/restart_services should allow multiple configuration files in a directory | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Rudolf Mayerhofer <rm> |
| Component: | Current packages | Assignee: | Marc Schiffbauer <mschiff> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | Keywords: | PATCH |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
Feature implementation example
Updated ebuild including the config_directory.patch |
||
|
Description
Rudolf Mayerhofer
2015-08-17 10:48:26 UTC
Created attachment 409232 [details, diff]
Feature implementation example
Implementation of the config directory feature (on restart_services-0.12.0). Also changes the example restart_services.conf to allow loading multiple config files.
Created attachment 409234 [details]
Updated ebuild including the config_directory.patch
The ebuild installs the config example as /etc/restart_services/00-restart_services-default.conf and also applies the config_directory.patch
Hi Rudolf, thanks for your patch! I like that idea.v ;-) However, I now implemented a slightly different approach: I added an include function that can be used in the main config file. So you can do "include /etc/restart_services.d/*.conf" To increase usability with things like that, the config variables can now optionally be arrays with regex elements instead of just one regex. So /etc/restart_services.conf may contain everyhing like it used to be and included files may contain something like this: SV_ALWAYS+=( myOtherService ) This approach makes new things possible while maintaining comapatibility with existing installations. Please try version 0.13.0 and feel free to reopen if this does not solve it for you. (In reply to Marc Schiffbauer from comment #3) > Hi Rudolf, > > thanks for your patch! I like that idea.v ;-) > > However, I now implemented a slightly different approach: I added an include > function that can be used in the main config file. So you can do "include > /etc/restart_services.d/*.conf" > > To increase usability with things like that, the config variables can now > optionally be arrays with regex elements instead of just one regex. > > So /etc/restart_services.conf may contain everyhing like it used to be and > included files may contain something like this: > > SV_ALWAYS+=( myOtherService ) > > This approach makes new things possible while maintaining comapatibility > with existing installations. > > Please try version 0.13.0 and feel free to reopen if this does not solve it > for you. Hello Marc, I like the way you implemented this feature (It's way cleaner than what i did). Would it be possible to enable the include in the config file installed with the package by default (Also creating an empty config directory by default. This wouldn't break any existing installations/change the way the config works) ? That way it would be possible to simply emerge restart_services and provide any other config files to config directory (even with another portage package). I'm asking this because in our current infrastructure (right now around ~15 VMs and growing) we deploy our config files from another ebuild from an internal package repository and we simply cannot update restart_services.conf in a clean manner as portage knows the file is claimed by the restart_services package. If the packaged restart_services.conf would have the include enabled by default we could just drop our restart_services config into the config directory as yet another file and our problem would be solved. Hi Rudolf, should be fixed for you with 0.13.0-r1 Have fun! -Marc |