Project

General

Profile

Feature #129

Allow overriding default settings with local option/config file

Added by Deoren Moor over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Core
Target version:
Start date:
10/13/2014
Due date:
% Done:

0%

Resolution:
Fixed

Description

Much like a lot of UNIX tools support, I'd like to be able to override script defaults with a local configuration file. That way some servers can report to a specific address and others can report to yet another address, or as may be appropriate an entirely different category. This could be used for example where patching duties vary between boxes and using a different category causes the scraped email to be assigned to a different group.

We can either have the script include a very specific file or it can look in order for a selection of files to import. MySQL for example supports importing from multiple files with the last one having the greatest precedence.

To start with, we'll support just one location for the file. Perhaps one of these locations?

  • /etc/whyaskwhy.org/email_updates/settings.conf
  • /etc/whyaskwhy.org/email_updates/settings.inc.conf
  • /etc/whyaskwhy.org/email_updates.conf
References

Related issues

Related to Feature #131: Check (optional) include file permissions/ownership before including it. Assigned 10/28/2014

Associated revisions

Revision 86 (diff)
Added by Deoren Moor over 2 years ago

[issues #129]
Beginning of working to allow customs settings to override predefined settings.

Custom_Settings

Revision 87 (diff)
Added by Deoren Moor over 2 years ago

[issues #129]
Added note to self to apply proper permissions check.

Revision 88 (diff)
Added by Deoren Moor over 2 years ago

[issues #129]
Opted to allow an array of locations for the override file to be included. I ran into at least one situation where having it in the same directory as the script would have been handy.

Revision 89 (diff)
Added by Deoren Moor over 2 years ago

[issues #129]
  • Fixed typo
  • Fixed logic used to get the path to the script (for include file reference) if script is called via a symbolic link

Light testing so far shows this to work well.

Revision 90 (diff)
Added by Deoren Moor over 2 years ago

[issues #129]
Tagging v0.2.5 from r89.

History

#1 Updated by Deoren Moor over 2 years ago

Note: The script need to confirm permissions are sane before including the file.

Note sure yet which of:

  • chmod o=rw,g=rw,o=
    • 660
  • chmod o=rw,g=r,o=
    • 640
  • chmod o=rw,g=,o=
    • 600

would be appropriate here. I'm leaning towards the second?

#2 Updated by Deoren Moor over 2 years ago

  • Subject changed from Allow overriding script defaults with local option/config file to Allow overriding default settings with local option/config file

#3 Updated by Deoren Moor over 2 years ago

I'm testing r87 on some of my personal boxes to see if anything breaks. Since the change is so minor I don't expect there will be problems.

#4 Updated by Deoren Moor over 2 years ago

  • Target version changed from 0.4 to 0.3

#5 Updated by Deoren Moor over 2 years ago

r89 has been working well for a bit. Since this particular feature would really come in handy for a stable rollout I'm going to move it to a separate milestone.

#6 Updated by Deoren Moor over 2 years ago

  • Target version changed from 0.3 to 0.2.5

#7 Updated by Deoren Moor over 2 years ago

Deoren Moor wrote:

Note: The script need to confirm permissions are sane before including the file.

Note sure yet which of:

  • chmod o=rw,g=rw,o=
    • 660
  • chmod o=rw,g=r,o=
    • 640
  • chmod o=rw,g=,o=
    • 600

would be appropriate here. I'm leaning towards the second?

I think I'll split this out into a separate feature. From what I've seen of init.d scripts (at least on Ubuntu), they don't check permissions or ownership before including them during script execution.

#8 Updated by Deoren Moor over 2 years ago

Split out as #131.

#9 Updated by Deoren Moor over 2 years ago

  • Related to Feature #131: Check (optional) include file permissions/ownership before including it. added

#10 Updated by Deoren Moor over 2 years ago

  • Status changed from Assigned to Closed
  • Resolution set to Fixed

r90 tags this as v0.2.5.

Also available in: Atom PDF