Changes

Jump to navigation Jump to search
m
Adjusting header(s)
Line 1: Line 1:  +
<div class="PART"><div class="TITLEPAGE">
 +
=II. SME Server internals=
 +
 +
<div class="TOC">
 +
 +
; '''Table of Contents'''
 +
; 6. [http://wiki.contribs.org/The_SME_Server_Developer%27s_Guide#CONFIG-DATABASE Configuration database]
 +
; 7. [http://wiki.contribs.org/The_SME_Server_Developer%27s_Guide#ACTIONS-EVENTS Actions and events]
 +
; 8. [http://wiki.contribs.org/The_SME_Server_Developer%27s_Guide#TEMPLATES Configuration file templates]
 +
; 9. [http://wiki.contribs.org/The_SME_Server_Developer%27s_Guide#PROCESSES Process startup, supervision and shutdown]
 +
; 10. [http://wiki.contribs.org/The_SME_Server_Developer%27s_Guide#WEB-INTERFACE The server-manager web interface]
 +
 +
</div></div>
 
<div class="CHAPTER">
 
<div class="CHAPTER">
=Configuration database=
+
==Configuration database==
    
<div class="SECT1">
 
<div class="SECT1">
   −
==Overview==
+
===Overview===
    
All user-modifiable configuration parameters on the SME Server are stored in the configuration database. These values are used to generate the system configuration files, such as those found in the <tt class="FILENAME">/etc/</tt> directory.
 
All user-modifiable configuration parameters on the SME Server are stored in the configuration database. These values are used to generate the system configuration files, such as those found in the <tt class="FILENAME">/etc/</tt> directory.
Line 19: Line 32:  
----
 
----
   −
===Simple entries===
+
====Simple entries====
    
Simple configuration database entries take the form of a key/value pair:
 
Simple configuration database entries take the form of a key/value pair:
Line 35: Line 48:  
----
 
----
   −
===Complex entries===
+
====Complex entries====
    
More complex entries consist of a key, a type, and a collection of property/value pairs:
 
More complex entries consist of a key, a type, and a collection of property/value pairs:
Line 55: Line 68:  
----
 
----
   −
===Access from the command line===
+
====Access from the command line====
    
You can access configuration database entries from the command line using the '''config''' command, as shown above, or the '''db''' command. The '''config''' command provides a shorthand for accessing the <span class="emphasis">''configuration''</span> database. The following commands are equivalent:
 
You can access configuration database entries from the command line using the '''config''' command, as shown above, or the '''db''' command. The '''config''' command provides a shorthand for accessing the <span class="emphasis">''configuration''</span> database. The following commands are equivalent:
Line 107: Line 120:  
----
 
----
   −
===Access via the Perl API===
+
====Access via the Perl API====
    
You can also access configuration database entries programmatically using the <code class="CLASSNAME">esmith::ConfigDB</code> and related Perl modules, which are abstractions for the <code class="CLASSNAME">esmith::DB</code> module.
 
You can also access configuration database entries programmatically using the <code class="CLASSNAME">esmith::ConfigDB</code> and related Perl modules, which are abstractions for the <code class="CLASSNAME">esmith::DB</code> module.
Line 147: Line 160:  
----
 
----
   −
===Database initialization===
+
====Database initialization====
    
The configuration databases are initialized from files in the <tt class="FILENAME">/etc/e-smith/db/</tt> hierarchy. These files can perform one of three actions:
 
The configuration databases are initialized from files in the <tt class="FILENAME">/etc/e-smith/db/</tt> hierarchy. These files can perform one of three actions:
Line 171: Line 184:  
----
 
----
   −
====Defaults files====
+
=====Defaults files=====
    
Defaults files are simple text files. If the corresponding database key/property already exists, it is skipped. Otherwise, the key/property is created and the value loaded. For example, this file:
 
Defaults files are simple text files. If the corresponding database key/property already exists, it is skipped. Otherwise, the key/property is created and the value loaded. For example, this file:
Line 183: Line 196:  
----
 
----
   −
====Force files====
+
=====Force files=====
    
Force files are just like defaults files, except they <span class="emphasis">''overwrite''</span> the existing value. So, this file:
 
Force files are just like defaults files, except they <span class="emphasis">''overwrite''</span> the existing value. So, this file:
Line 195: Line 208:  
----
 
----
   −
====Migrate fragments====
+
=====Migrate fragments=====
    
Migrate fragments are small pieces of Perl text which can be used to perform more complex migrations than is possible with defaults and force files. They would normally be used to replace database keys or properties with new names, or to adjust policy settings during an upgrade.
 
Migrate fragments are small pieces of Perl text which can be used to perform more complex migrations than is possible with defaults and force files. They would normally be used to replace database keys or properties with new names, or to adjust policy settings during an upgrade.
Line 221: Line 234:  
----
 
----
   −
====Important notes about migrate fragments====
+
=====Important notes about migrate fragments=====
    
* Please be careful with migrate fragments. Although they should only modify entries within the current database, there are no restrictions placed on what they can do. The ability to open and even modify other databases may be required to perform a migration.
 
* Please be careful with migrate fragments. Although they should only modify entries within the current database, there are no restrictions placed on what they can do. The ability to open and even modify other databases may be required to perform a migration.
Line 233: Line 246:  
----
 
----
   −
====Evaluation order: migrate, defaults, force====
+
=====Evaluation order: migrate, defaults, force=====
    
When a database is loaded:
 
When a database is loaded:
Line 246: Line 259:  
----
 
----
   −
====Forcing database initialization====
+
=====Forcing database initialization=====
    
The database is initialized during a number of events, including '''console-save''', so a call to '''signal-event console-save''' will evaluate all of the database fragments.
 
The database is initialized during a number of events, including '''console-save''', so a call to '''signal-event console-save''' will evaluate all of the database fragments.
Line 259: Line 272:  
----
 
----
   −
===Important notes about the configuration databases===
+
====Important notes about the configuration databases====
    
* The configuration databases should only be modified using the tools and APIs provided.
 
* The configuration databases should only be modified using the tools and APIs provided.
Line 274: Line 287:  
----
 
----
   −
==The configuration databases==
+
===The configuration databases===
    
<div class="SECT2">
 
<div class="SECT2">
   −
===Configuration===
+
====Configuration====
    
The most important database is the (master) configuration database. This database describes how the system should operate; the type of Internet access to use, how email should be handled, and so on.
 
The most important database is the (master) configuration database. This database describes how the system should operate; the type of Internet access to use, how email should be handled, and so on.
Line 287: Line 300:  
----
 
----
   −
===Accounts===
+
====Accounts====
    
Account details are stored in the <tt class="FILENAME">accounts</tt> database, as complex entries. We classify accounts into several types, including:
 
Account details are stored in the <tt class="FILENAME">accounts</tt> database, as complex entries. We classify accounts into several types, including:
Line 302: Line 315:  
----
 
----
   −
===Domains===
+
====Domains====
    
The domains database shows the domains handled by this server, including information about how to handle web requests, and the DNS servers for the domain.
 
The domains database shows the domains handled by this server, including information about how to handle web requests, and the DNS servers for the domain.
Line 309: Line 322:  
----
 
----
   −
===Networks===
+
====Networks====
    
The networks database details the networks which should be treated as local by this server. Local networks have additional access rights which are denied for other networks.
 
The networks database details the networks which should be treated as local by this server. Local networks have additional access rights which are denied for other networks.
Line 316: Line 329:  
----
 
----
   −
===Hosts===
+
====Hosts====
    
The hosts database decribes all hosts/machines known to this server and is used to generate DHCP and DNS configuration.
 
The hosts database decribes all hosts/machines known to this server and is used to generate DHCP and DNS configuration.
Line 323: Line 336:  
----
 
----
   −
===Other configuration databases===
+
====Other configuration databases====
    
There are several other configuration databases stored with the ones listed above, and the system design allows for additional databases to be created as required.
 
There are several other configuration databases stored with the ones listed above, and the system design allows for additional databases to be created as required.
Line 330: Line 343:  
----
 
----
   −
==Namespace issues==
+
===Namespace issues===
    
All entries in a single database share the same namespace. Users, groups, information bays, printers, and other entries in the accounts database currently all share one namespace. This means that you cannot have a user with the same name as an information bay, group or other entry in the accounts database.
 
All entries in a single database share the same namespace. Users, groups, information bays, printers, and other entries in the accounts database currently all share one namespace. This means that you cannot have a user with the same name as an information bay, group or other entry in the accounts database.

Navigation menu