04.06.2013 Views

UCS 2.4 - Univention

UCS 2.4 - Univention

UCS 2.4 - Univention

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

14 <strong>Univention</strong> Configuration Registry<br />

Variables: ldap/server/name<br />

Variables: dhcpd/enable<br />

Type: file<br />

File: etc/init.d/dhcp3-server<br />

The templates for all configuration files managed with <strong>Univention</strong> Configuration Registry can be<br />

found in the /etc/univention/templates/files. The path to the templates is the abso-<br />

lute path to the configuration file with the prefixed path to the template directory. For ex-<br />

ample, the template for the /etc/dhcp3/dhcpd.conf configuration file can be found under<br />

/etc/univention/templates/files/etc/dhcp3/dhcpd.conf.<br />

The templates contain wildcards for the variables used in the registration. If the value of a variable is<br />

changed, <strong>Univention</strong> Configuration Registry reads the template and replaces the wildcard with the corre-<br />

sponding variable value before rewriting the configuration file.<br />

The following excerpt serves as an example of a line with wildcards from the template for the file<br />

/etc/ssh/sshd_config. The name of the <strong>Univention</strong> Configuration Registry variable framed by the<br />

string @%@ represents the wildcard.<br />

X11Forwarding @%@sshd/xforwarding@%@<br />

The original configuration file is overwritten when a registered <strong>Univention</strong> Configuration Registry variable<br />

is changed, which means that manual changes previously made to the configuration file will be lost. If<br />

these changes are to be permanent, they must be made to the template. Once the template has been<br />

changed, the configuration file needs to be rewritten (see Chapter 14.8).<br />

Attention:<br />

For the configuration files to be processed correctly by <strong>Univention</strong> Configuration Registry they must be<br />

in UNIX format. If configuration files are edited in DOS or Windows, for example, control characters are<br />

inserted to indicate line breaks, which can disrupt the way <strong>Univention</strong> Configuration Registry uses the file.<br />

The string @!@ can also be used alongside the string @%@ for individual <strong>Univention</strong> Configuration Reg-<br />

istry variables. It is used to mark Python codes embedded in blocks. The Python code is also executed<br />

when a registered <strong>Univention</strong> Configuration Registry variable is changed. For example, these blocks can<br />

be used to set it so that when a parameter is changed via a variable, further dependent settings in are au-<br />

tomatically adopted in the configuration file. The following code sequence configures for example network<br />

settings using the <strong>Univention</strong> Configuration Registry settings:<br />

@!@<br />

for i in range(0,4):<br />

if baseConfig[’interfaces/eth%s/address’ % i]:<br />

print ’%s\tunivention-directory-manager.%s univention-directory-manager’ % \<br />

(baseConfig[’interfaces/eth%s/address’ % i],baseConfig[’domainname’])<br />

@!@<br />

If new Python code is entered into the templates or the existing code changed in such a way that it requires<br />

additional or different variable, the .info files in /etc/univention/templates/info will need to be<br />

expanded or changed accordingly (see Chapter 14.10).<br />

Attention:<br />

<strong>Univention</strong> Configuration Registry templates are included in the corresponding software packages as<br />

282

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!