Changes

Jump to navigation Jump to search
Line 2: Line 2:  
=II. SME Server internals=
 
=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==
Line 24: Line 14:     
Each entry in the database is either a simple key/value pair or a key and a collection of related property/value pairs.
 
Each entry in the database is either a simple key/value pair or a key and a collection of related property/value pairs.
 
+
{{Note box|msg=The section describes the general structure of the configuration database. The actual entries and properties are subject to change between releases.}}
<div class="NOTE"><blockquote class="NOTE">
+
<div class="SECT2">
 
  −
'''Note: '''The section describes the general structure of the configuration database. The actual entries and properties are subject to change between releases.
  −
 
  −
</blockquote></div><div class="SECT2">
   
----
 
----
   Line 77: Line 63:  
  [root@gsxdev1 ~]# db configuration show LocalIP
 
  [root@gsxdev1 ~]# db configuration show LocalIP
 
  LocalIP=192.168.1.100
 
  LocalIP=192.168.1.100
 +
{{Note box|msg=The term ''configuration database'' is used both to refer to the "master" ''configuration'' database and to refer collectively to the set of configuration databases, which includes the individual ''accounts'', ''networks'' and ''configuration'' databases.}}
   −
<div class="NOTE"><blockquote class="NOTE">
+
The '''db''' allows you to access all of the databases. For example to show the details of the <var class="LITERAL">admin</var> entry from ''accounts''
 
  −
'''Note: '''The term <span class="emphasis">''configuration database''</span> is used both to refer to the "master" <span class="emphasis">''configuration''</span> database and to refer collectively to the set of configuration databases, which includes the individual <span class="emphasis">''accounts''</span>, <span class="emphasis">''networks''</span>, and <span class="emphasis">''configuration''</span> databases.
  −
 
  −
</blockquote></div>
  −
 
  −
The '''db''' allows you to access all of the databases. For example to show the details of the <var class="LITERAL">admin</var> entry from <span class="emphasis">''accounts''</span>
      
  [root@gsxdev1 ~]# db accounts show admin
 
  [root@gsxdev1 ~]# db accounts show admin
Line 239: Line 220:  
* Migrate fragments must be safe to run multiple times. They should migrate the value when required and do nothing in other cases.
 
* Migrate fragments must be safe to run multiple times. They should migrate the value when required and do nothing in other cases.
 
* Migrate fragments should never call croak or die. This will cause the database migration to stop. If an error is detected, call carp or warn to note the error in the logs.
 
* Migrate fragments should never call croak or die. This will cause the database migration to stop. If an error is detected, call carp or warn to note the error in the logs.
 +
* Migrate fragments should call good termination with return(0) rather than exit(0).
 
* Migrate fragments should be owned by the package requiring the migration so that the migration only occurs when that package is installed.
 
* Migrate fragments should be owned by the package requiring the migration so that the migration only occurs when that package is installed.
 
* Migrate fragments should be self-contained and ideally perform only one migration per fragment.
 
* Migrate fragments should be self-contained and ideally perform only one migration per fragment.
* It is also possible to initialize and migrate database values in action scripts, but creation of migrate fragments is <span class="emphasis">''strongly''</span> preferred. Creating defaults is a simple matter of creating text files and migrate fragments require far less code than action scripts.
+
* It is also possible to initialize and migrate database values in action scripts, but creation of migrate fragments is '''strongly''' preferred. Creating defaults is a simple matter of creating text files and migrate fragments require far less code than action scripts.
    
</div><div class="SECT3">
 
</div><div class="SECT3">
Line 262: Line 244:     
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.
 +
{{Note box|msg=The '''console-save''' event is not a "reconfigure everything" event, and only changes items which can be configured from the text-mode console. It is convenient in this case as it performs database initialization and migration.
   −
<div class="NOTE"><blockquote class="NOTE">
+
It is an SME Server requirement that all database entries and configuration files must be correctly configured after a "reconfiguration reboot". This is available from the console and server manager and performs the '''post-upgrade''' and '''reboot''' events. Packages should also provide links in other events (e.g. "email-update" for email related changes) to provide reconfiguration without the reboot.}}
 
+
</div></div><div class="SECT2">
'''Note: '''The '''console-save''' event is not a "reconfigure everything" event, and only changes items which can be configured from the text-mode console. It is convenient in this case as it performs database initialization and migration.
  −
 
  −
It is an SME Server requirement that all database entries and configuration files must be correctly configured after a "reconfiguration reboot". This is available from the console and server manager and performs the '''post-upgrade''' and '''reboot''' events. Packages should also provide links in other events (e.g. "email-update" for email related changes) to provide reconfiguration without the reboot.
  −
 
  −
</blockquote></div></div></div><div class="SECT2">
   
----
 
----
  

Navigation menu