Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 558006 - app-admin/restart_services should allow multiple configuration files in a directory
Summary: app-admin/restart_services should allow multiple configuration files in a dir...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Marc Schiffbauer
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2015-08-17 10:48 UTC by Rudolf Mayerhofer
Modified: 2015-09-07 14:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Feature implementation example (config_directory.patch,5.24 KB, patch)
2015-08-17 10:51 UTC, Rudolf Mayerhofer
Details | Diff
Updated ebuild including the config_directory.patch (restart_services-0.12.0-r1000.ebuild,678 bytes, text/plain)
2015-08-17 10:53 UTC, Rudolf Mayerhofer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rudolf Mayerhofer 2015-08-17 10:48:26 UTC
When using restart_services in a larger environment it is desirable to have multiple (possibly not portage-managed) configuration files within a configuration file directory (e.g. /etc/restart_services). 
This allows for easier central management of the configuration variables of restart_services and also allows a per-application config file (if wanted or necessary).

Reproducible: Always
Comment 1 Rudolf Mayerhofer 2015-08-17 10:51:46 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.
Comment 2 Rudolf Mayerhofer 2015-08-17 10:53:59 UTC
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
Comment 3 Marc Schiffbauer gentoo-dev 2015-09-03 00:41:22 UTC
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.
Comment 4 Rudolf Mayerhofer 2015-09-05 16:30:05 UTC
(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.
Comment 5 Marc Schiffbauer gentoo-dev 2015-09-07 14:15:24 UTC
Hi Rudolf,

should be fixed for you with 0.13.0-r1

Have fun!

-Marc