CT320

CT320: Network and System Administration

Fall 2015

Config

See this page as a slide show

CT320: Configuration Information

blix

Consider the blix command (I made it up), which blixes things. It requires configuration information.

A configuration file

The straightforward solution is to have a configuration file, /etc/blix.conf. It’s installed as part of the blix package, and contains default values, such as:

    Frequency: 30m		# Every 30 minutes
    Priority: medium
    Level: 3			# 1 is lowest level, 5 is highest level
    Users: root			# Only root is permitted to blix

To allow user sanchez to blix, change the last line to:

    Users: root,sanchez		# Sanchez, too!

Problem

What happens when a new revision of the blix package comes out? A new parameter has been added to /etc/blix.conf. However, you’ve edited /etc/blix.conf:

Old New
    Frequency: 30m
    Priority: medium
    Level: 3
    Users: root,sanchez
    Frequency: 30m
    Priority: medium
    Level: 3
    Users: root
    Compression: xz

Conflict! When you update, you’ll have to merge that file manually. Ack!

Solution #1

You could have separate system & user config files:

/etc/blix.system.conf would be reserved for the system defaults, and /etc/blix.user.conf would be available for user editing.

That sounds great, but …

Problem

What if another package wants to add some blixing information? Say that the vim package wants to add a line to the blix configuration file to specify how often ~/.vimrc should be blixed?

Whichever file it modifies, we’ll have the same old problem at the next update.

Maybe we should have a whole bunch of configuration files!

A Whole Bunch of Configuration Files

That’s the best solution: instead of a single configuration file /etc/blix.conf, have a directory /etc/blix.d. The blix program will treat all files in /etc/blix.d as configration file. If the order matters, we can put prefixes in the filenames to force processing order.

The filenames will be unique, as long as two packages don’t use the same name.

Modified: 2015-10-04T14:14

User: Guest

Check: HTML CSS
Edit History Source
Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2015 Colorado State University
CS Building