Ticket #298 (new enhancement)
Use a rules.d directory for seperate rules files in oeventsd
| Reported by: | digger | Owned by: | jluebbe |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | framework/oeventsd | Version: | |
| Keywords: | HasPatch | Cc: |
Description
Use individual rules files in a /etc/freesmartphone/oevents/rules.d directory rather than a monolithic rules file.
The included patch first parses the rules.yaml file and then any files it finds in rules.d. The patch has been tested with a button-aux.yaml file. The patch does not create a rules.d directory.
This would allow update-alternatives to select rules files. For example: Do I want fso-control or paroli to be launched from the AUX button?
This works as is however it could be expanded to other possibilities. Similar to apache2 (at least in Debian type systems) there could be rules-available and rules-enabled directories. Utilities similar to a2enmod and a2dismod could be written or perhaps even a GUI.
Depending on where oeventsd goes in the future, the rules files could have priorities as are used in /etc/init.d and and /etc/rc.X.d
I included the parse_rules_file function under the factory function because I had trouble seperating it.
