[Merge] lp:~xnox/upstart/overrides into lp:upstart

Dmitrijs Ledkovs launchpad at surgut.co.uk
Fri Jan 4 13:41:19 UTC 2013


Dmitrijs Ledkovs has proposed merging lp:~xnox/upstart/overrides into lp:upstart.

Requested reviews:
  Upstart Reviewers (upstart-reviewers)

For more details, see:
https://code.launchpad.net/~xnox/upstart/overrides/+merge/141914

This branch implements override files from any directory as specified here [1].

Instead of checking for a known path to .override file, a helper function `conf_get_best_override' is used that iterates across conf_sources and looks for the first .override file.

Next, I refactored another helper function conf_load_path_with_override that: loads a conf file, finds best override file for it & if found, applies it.

For the handlers we now have the following logic:
- if a .conf file is  created/modified: simply call conf_load_path_with_override.
- if a .override file is created/modified/deleted: iterate across all conf_sources, check for "matching" .conf file and reload it with conf_load_path_with_override.
- if a .conf file is deleted: the behaviour is the same, unref the file from the ConfSource.

For system init, there shouldn't be much performance impact since there is only one directory to do lookups in.

For session init, most jobs will be in the lowest priority config_source. Thus resulting in lstat call in each config_source for each job to check for an .override file. But in practice, those higher priority config_sources may not even exist and lstat calls on non-existing directories is cheap. Potentially this can be micro-optimised by storing hashes of all found .override files while walking the config_sources and then instead of lstat check do a hash lookup...

[1] https://wiki.ubuntu.com/FoundationsTeam/Specs/RaringUpstartUserSessions#Configuration_Files_for_User_Jobs
-- 
https://code.launchpad.net/~xnox/upstart/overrides/+merge/141914
Your team Upstart Reviewers is requested to review the proposed merge of lp:~xnox/upstart/overrides into lp:upstart.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: review-diff.txt
Type: text/x-diff
Size: 21362 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/upstart-devel/attachments/20130104/3ed6b566/attachment.diff>


More information about the upstart-devel mailing list