<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Abraxas &#187; Gentoo</title>
	<atom:link href="http://www.effinger.org/blog/tag/gentoo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.effinger.org/blog</link>
	<description>a personal knowledge base</description>
	<lastBuildDate>Mon, 23 Jan 2012 22:05:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mit strace prüfen, was ein Programm so treibt</title>
		<link>http://www.effinger.org/blog/2010/05/08/mit-strace-prufen-was-ein-programm-so-treibt/</link>
		<comments>http://www.effinger.org/blog/2010/05/08/mit-strace-prufen-was-ein-programm-so-treibt/#comments</comments>
		<pubDate>Sat, 08 May 2010 20:19:13 +0000</pubDate>
		<dc:creator>Markus Effinger</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[strace]]></category>

		<guid isPermaLink="false">http://www.effinger.org/blog/?p=986</guid>
		<description><![CDATA[<p>Manchmal kommt man mit Fehlermeldungen von Programmen einfach nicht weiter. Bevor man jedoch im Trial- und Errorverfahren Konfigurationsparameter ausprobiert, um dem Fehler auf die Spur zu kommen oder gleich ein alternatives Programm wählt, kann man strace bemühen. Dieses kleine Programm erlaubt es Systemaufrufe eines Programmes zu protokollieren.</p> Die wichtigsten Parameter von strace -o filename schreibt [...]]]></description>
			<content:encoded><![CDATA[<p>Manchmal kommt man mit Fehlermeldungen von Programmen einfach nicht weiter. Bevor man jedoch im Trial- und Errorverfahren Konfigurationsparameter ausprobiert, um dem Fehler auf die Spur zu kommen oder gleich ein alternatives Programm wählt, kann man strace bemühen. Dieses kleine Programm erlaubt es Systemaufrufe eines Programmes zu protokollieren.</p>
<h3>Die wichtigsten Parameter von strace</h3>
<ul>
<li><em>-o filename</em> schreibt die Ausgabe in die Datei <em>filename</em></li>
<li><em>-f</em> mit diesem Parameter protokolliert das Programm auch forks (d.h. neue Prozesse, die durch das zu protokollierende Programm gestartet werden)</li>
<li><em>-tt</em> mit diesem Parameter wird vor jedem Aufruf zunächst die Zeit protokolliert (auf Basis von Mikrosekunden)</li>
<li><em>-e</em> schränkt die Events ein, die strace protokolliert (siehe Beispiele weiter unten)</li>
<li><em>-p PID</em> strace protokolliert die Systemaufrufe des Prozesses mit der Prozess-ID <em>PID</em></li>
</ul>
<p>Ein beispielhafter Aufruf sieht dann so aus</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">strace</span> <span style="color: #660033;">-o</span> logfile.log <span style="color: #660033;">-f</span> .<span style="color: #000000; font-weight: bold;">/</span>mycommand <span style="color: #660033;">-mycommandparameter</span></pre></div></div>

<p>Im Folgenden sind einige nützliche Beispiele für spezielle Programmaufrufe aufgeführt.</p>
<h3>Auf welche Dateien greift ein Programm zu?</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">strace</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">trace</span>=open <span style="color: #660033;">-o</span> logfile.log .<span style="color: #000000; font-weight: bold;">/</span>mycommand <span style="color: #660033;">-mycommandparameter</span></pre></div></div>

<p>Das habe ich mir von <a href="http://www.netadmintools.com/art353.html">NetAdminTools</a> abgeschaut.</p>
<h3>Welche Programme startet/pausiert/beendet das Programm?</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">strace</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">trace</span>=process <span style="color: #660033;">-o</span> logfile.log .<span style="color: #000000; font-weight: bold;">/</span>mycommand <span style="color: #660033;">-mycommandparameter</span></pre></div></div>

<h3>Wie protokolliere ich die Systemaufrufe eine Programms, das schon gestartet ist?</h3>
<p>Hierfür gibt es den Parameter <em>-p</em> von strace, mit dem man die entsprechende Prozess-ID des Programms an strace übergibt. Um diese ID herauszufinden bemüht man zunächst ps, welches mit dem folgenden Befehl die IDs aller laufenden Prozesse mit dem Namen mycommand auflistet.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ps</span> aux <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> mycommand <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> mycommand</pre></div></div>

<p>Wer es kürzer haben möchte, sollte sich meine <a href="http://www.effinger.org/blog/2008/11/20/arbeitserleichterung-durch-bashrc-und-bash_aliases/">bashrc</a> anschauen, in der eine Funktion pg definiert ist, die mit dem Aufruf</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pg mycommand</pre></div></div>

<p>dasselbe Resultat erzielt. Angenommen die Ausgabe in der Spalte PID lautet 123, dann würde man strace folgendermaßen aufrufen.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">strace</span> <span style="color: #660033;">-o</span> logfile.log <span style="color: #660033;">-p</span> <span style="color: #000000;">123</span></pre></div></div>

<p>Falls es mit Sicherhheit nur ein Programm namens mycommand läuft, geht das auch schneller mit einem</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">strace</span> <span style="color: #660033;">-o</span> logfile.log <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">pidof</span> mycommand<span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>strong<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>strong<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #c20cb9; font-weight: bold;">strace</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">trace</span>=open<span style="color: #000000; font-weight: bold;">&lt;/</span>strong<span style="color: #000000; font-weight: bold;">&gt;&lt;/</span>strong<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

</div>
<h3>Wie versteht man die Ausgabe von strace?</h3>
<p>Am Beispiel der folgenden Ausgabe wollen wir mal grob nachvollziehen, was ein Programm gerade macht</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">execve<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;/bin/cat&quot;</span>, <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;cat&quot;</span>, <span style="color: #ff0000;">&quot;/var/log/messages&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>, <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000;">37</span> vars <span style="color: #000000; font-weight: bold;">*/</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> = <span style="color: #000000;">0</span></pre></div></div>

<p>Was macht der Befehl execve? Dazu rufen wir mit</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">man</span> execve</pre></div></div>

<p>die entsprechende Hilfedatei auf und erfahren dort, dass das Programm cat mit dem Parameter /var/log/messages gestartet wird.</p>
<p>Welche Tips und Kniffe fallen euch noch im Zusammenhang mit strace ein?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.effinger.org/blog/2010/05/08/mit-strace-prufen-was-ein-programm-so-treibt/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>OpenLDAP für pam_ldap, nss_ldap unter Gentoo im Schnelldurchgang einrichten</title>
		<link>http://www.effinger.org/blog/2010/05/08/openldap-fur-pam_ldap-nss_ldap-unter-gentoo-im-schnelldurchgang-einrichten/</link>
		<comments>http://www.effinger.org/blog/2010/05/08/openldap-fur-pam_ldap-nss_ldap-unter-gentoo-im-schnelldurchgang-einrichten/#comments</comments>
		<pubDate>Sat, 08 May 2010 19:11:28 +0000</pubDate>
		<dc:creator>Markus Effinger</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[eGroupware]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[nss_ldap]]></category>
		<category><![CDATA[OpenLDAP]]></category>
		<category><![CDATA[pam_ldap]]></category>

		<guid isPermaLink="false">http://www.effinger.org/blog/?p=1013</guid>
		<description><![CDATA[<p>In diesem Artikel geht es darum, mit OpenLDAP die Basis für ein Benutzersystem unter Gentoo zu legen und die Linux-Authentifizierung mittels pam_ldap und nss_ldap an diese Basis anzubinden. Unter Gentoo ist die LDAP-Einrichtung zwar grundsätzlich ähnlich wie zu der Beschreibung in meinen anderen Blog-Artikeln (Das kleine OpenLDAP 1&#215;1, OpenLDAP im Mailserversetup unter Ubuntu) beschrieben hatte, [...]]]></description>
			<content:encoded><![CDATA[<p>In diesem Artikel geht es darum, mit OpenLDAP die Basis für ein Benutzersystem unter Gentoo zu legen und die Linux-Authentifizierung mittels <a href="http://www.padl.com/OSS/pam_ldap.html">pam_ldap</a> und <a href="http://www.padl.com/nss_ldap.html">nss_ldap</a> an diese Basis anzubinden. Unter Gentoo ist die LDAP-Einrichtung zwar grundsätzlich ähnlich wie zu der Beschreibung in meinen anderen Blog-Artikeln (<a href="http://www.effinger.org/blog/2008/12/14/das-kleine-openldap-1x1/">Das kleine OpenLDAP 1&#215;1</a>, <a href="http://www.effinger.org/blog/2009/03/22/dovecot-exim-openldap-und-getmail-unter-ubuntu-1-openldap/">OpenLDAP im Mailserversetup unter Ubuntu</a>) beschrieben hatte, allerdings gibt es an der ein oder anderen Stelle ein paar Unterschiede. Damit ich diese selbst nicht vergesse, wenn ich das nächste Mal OpenLDAP einrichte, dokumentiere ich meine Vorgehensweise. Sie orientiert sich vor allem an einem <a href="http://wiki.das-online.org/howtos/ldap/openldap-gentoo">Wikiartikel zu OpenLDAP</a> und der <a href="http://www.gentoo.org/doc/de/ldap-howto.xml">Gentoo-Dokumentation</a>.</p>
<h3>Installation von OpenLDAP</h3>
<p>Vor der Installation von OpenLDAP habe ich für meine Bedürfnisse die folgenden USE Flags in /etc/portage/package.use definiert</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">net-nds/openldap berkdb crypt perl ssl tcpd gnutls overlays samba syslog</pre></div></div>

<p>um anschließend die Installation zu starten mit einem</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">emerge openldap</pre></div></div>

<h3>Grundkonfiguration von OpenLDAP</h3>
<p>Zunächst erzeugen wir mit</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">slappasswd <span style="color: #660033;">-h</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>CRYPT<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>ein Passwort für die RootDN (später olcRootPW). Im Beispiel ergibt sich die Zeichenfolge {CRYPT}xVllx1Fyd0nd2 für &#8220;test&#8221; als Passwort. Nun editieren wir die Datei/etc/openldap/slapd.conf und ändern die Datenbankdefinitionen wie folgt ab</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#######################################################################</span>
<span style="color: #666666; font-style: italic;"># BDB database definition for dc=log</span>
<span style="color: #666666; font-style: italic;">#######################################################################</span>
&nbsp;
database        hdb
suffix          <span style="color: #ff0000;">&quot;dc=logs&quot;</span>
<span style="color: #666666; font-style: italic;">#</span>
checkpoint      <span style="color: #000000;">32</span>      <span style="color: #000000;">30</span>
rootdn          <span style="color: #ff0000;">&quot;cn=admin,dc=logs&quot;</span>
<span style="color: #666666; font-style: italic;"># Cleartext passwords, especially for the rootdn, should</span>
<span style="color: #666666; font-style: italic;"># be avoid.  See slappasswd(8) and slapd.conf(5) for details.</span>
<span style="color: #666666; font-style: italic;"># Use of strong authentication encouraged.</span>
rootpw          <span style="color: #7a0874; font-weight: bold;">&#123;</span>CRYPT<span style="color: #7a0874; font-weight: bold;">&#125;</span>xVllx1Fyd0nd2
<span style="color: #666666; font-style: italic;"># The database directory MUST exist prior to running slapd AND</span>
<span style="color: #666666; font-style: italic;"># should only be accessible by the slapd and slap tools.</span>
<span style="color: #666666; font-style: italic;"># Mode 700 recommended.</span>
directory       <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>openldap-data-logs
<span style="color: #666666; font-style: italic;"># Indices to maintain</span>
index   objectClass     eq
&nbsp;
<span style="color: #666666; font-style: italic;">#######################################################################</span>
<span style="color: #666666; font-style: italic;">## BDB database definition for dc=effinger,dc=org</span>
<span style="color: #666666; font-style: italic;">########################################################################</span>
<span style="color: #666666; font-style: italic;">#</span>
database        hdb
suffix          <span style="color: #ff0000;">&quot;dc=effinger,dc=org&quot;</span>
<span style="color: #666666; font-style: italic;">#</span>
checkpoint      <span style="color: #000000;">32</span>      <span style="color: #000000;">30</span>
rootdn          <span style="color: #ff0000;">&quot;cn=admin,dc=effinger,dc=org&quot;</span>
<span style="color: #666666; font-style: italic;"># Cleartext passwords, especially for the rootdn, should</span>
<span style="color: #666666; font-style: italic;"># be avoid.  See slappasswd(8) and slapd.conf(5) for details.</span>
<span style="color: #666666; font-style: italic;"># Use of strong authentication encouraged.</span>
rootpw          <span style="color: #7a0874; font-weight: bold;">&#123;</span>CRYPT<span style="color: #7a0874; font-weight: bold;">&#125;</span>xVllx1Fyd0nd2
<span style="color: #666666; font-style: italic;"># The database directory MUST exist prior to running slapd AND</span>
<span style="color: #666666; font-style: italic;"># should only be accessible by the slapd and slap tools.</span>
<span style="color: #666666; font-style: italic;"># Mode 700 recommended.</span>
directory       <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>openldap-data-effinger.org
<span style="color: #666666; font-style: italic;"># Indices to maintain</span>
index   objectClass     eq</pre></div></div>

<p>Passwörter und die Domain müssen natürlich angepasst werden. Der Kontext dc=log wird übrigens zur Protokollierung der Zugriffe erstellt. Im nächsten Schritt erzeugen wir die notwendigen Verzeichnisse und setzen deren Berechtigungen.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>openldap-data-logs <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>openldap-data-effinger.org <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>slapd.d
<span style="color: #c20cb9; font-weight: bold;">chown</span> ldap.ldap <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>openldap-data-logs <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> ldap.ldap <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>openldap-data-effinger.org<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> ldap.ldap <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>slapd.d
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>openldap-data-logs <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>openldap-data-effinger.org <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">750</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>slapd.d</pre></div></div>

<p>Nun erzeugen wir aus der bestehenden slapd.conf das neuere LDIF-basierte Konfigurationsschema in das Verzeichnis /etc/openldap/slapd.d mit dem Befehl</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>slapd <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>slapd.conf <span style="color: #660033;">-F</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>slapd.d</pre></div></div>

<p>Danach beenden wir slapd mit</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #660033;">-s</span> <span style="color: #000000;">15</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">pidof</span> slapd<span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>Nun müssen wir nur noch das Passwort für die Konfiguration festlegen. Dazu editieren wir /etc/openldap/slapd.d/cn\=config/olcDatabase\=\{0\}config.ldif und fügen die Zeile olcRootPW unterhalb von olcRootDN hinzu:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">olcRootDN: <span style="color: #007800;">cn</span>=config
olcRootPW: <span style="color: #7a0874; font-weight: bold;">&#123;</span>CRYPT<span style="color: #7a0874; font-weight: bold;">&#125;</span>xVllx1Fyd0nd2</pre></div></div>

<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">slappasswd <span style="color: #660033;">-h</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>MD5</pre></div></div>

</div>
<p>Wir gehen jetzt nochmal auf Nummer sicher mit den Verzeichnis- und Dateiberechtigungen</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-Rfv</span> ldap.ldap <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>slapd.d
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-Rfv</span> <span style="color: #000000;">700</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>slapd.d<span style="color: #000000; font-weight: bold;">/*</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-Rfv</span> ldap.ldap <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>openldap-data-logs
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-Rfv</span> ldap.ldap <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>openldap-data-effinger.org</pre></div></div>

<p>und editieren wir die Datei /etc/openldap/ldap.conf, um dort die Parameter entsprechend anzupassen</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">BASE    dc=effinger,dc=org
TLS_CACERT /etc/ssl/certs/ca-certificates.crt
URI     ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock</pre></div></div>

<p>Dann passen wir noch die Startparameter von OpenLDAP an in der Datei /etc/conf.d/slapd und deaktivieren hier zunächst SSL.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># conf.d file for openldap</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># To enable both the standard unciphered server and the ssl encrypted</span>
<span style="color: #666666; font-style: italic;"># one uncomment this line or set any other server starting options</span>
<span style="color: #666666; font-style: italic;"># you may desire.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># OPTS=&quot;-h 'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock'&quot;</span>
<span style="color: #666666; font-style: italic;"># Uncomment the below to use the new slapd configuration for openldap 2.3</span>
<span style="color: #666666; font-style: italic;">#OPTS=&quot;-F /etc/openldap/slapd.d -h 'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock'&quot;</span>
<span style="color: #007800;">OPTS</span>=<span style="color: #ff0000;">&quot;-F /etc/openldap/slapd.d -h 'ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock'&quot;</span></pre></div></div>

<p>Abschließend fügen wir den OpenLDAP slapd Daemon zu den Services hinzu, die beim Hochfahren des Systems automatisch gestartet werden, und starten ihn</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rc-update add slapd default
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>slapd start</pre></div></div>

<p>Bevor aber Daten eingegeben werden können, müssen wir die dazu  erforderlichen Schemas einbinden mit</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ldapadd <span style="color: #660033;">-D</span> <span style="color: #ff0000;">&quot;cn=config&quot;</span> <span style="color: #660033;">-x</span> <span style="color: #660033;">-W</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>schema<span style="color: #000000; font-weight: bold;">/</span>cosine.ldif
ldapadd <span style="color: #660033;">-D</span> <span style="color: #ff0000;">&quot;cn=config&quot;</span> <span style="color: #660033;">-x</span> <span style="color: #660033;">-W</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>schema<span style="color: #000000; font-weight: bold;">/</span>inetorgperson.ldif
ldapadd <span style="color: #660033;">-D</span> <span style="color: #ff0000;">&quot;cn=config&quot;</span> <span style="color: #660033;">-x</span> <span style="color: #660033;">-W</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>schema<span style="color: #000000; font-weight: bold;">/</span>rfc2307bis.ldif
ldapadd <span style="color: #660033;">-D</span> <span style="color: #ff0000;">&quot;cn=config&quot;</span> <span style="color: #660033;">-x</span> <span style="color: #660033;">-W</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openldap<span style="color: #000000; font-weight: bold;">/</span>schema<span style="color: #000000; font-weight: bold;">/</span>samba.ldif</pre></div></div>

<p>Wegen eGroupware ist es wichtig, das rfc2307bis-Schema und nicht das  nis-Schema zu verwenden. Falls zuvor das nis-Schema verwendet wurde,  sollte man zur Migration der entsprechenden <a href="http://svn.egroupware.org/egroupware/tags/1.4-beta3/phpgwapi/doc/ldap/README">Anleitung  von eGroupware</a> folgen. Vor der Migration sollte man am Besten das  Konfigurationsschema und den <a href="http://www.linuxforen.de/forums/showthread.php?t=263822">Datenbankinhalt  mit slapcat sichern</a>, um nach der Umstellung die <a href="http://www.openldap.org/lists/openldap-software/200406/msg00723.html">Datenbank  zu löschen</a> und mit slapadd wiederherzustellen.</p>
<p>Falls noch keine rfc2307bis.ldif vorhanden ist, kann man sich diese Datei nach meiner <a href="http://www.effinger.org/blog/2009/02/08/ldif-dateien-zur-konfiguration-von-openldap-bequem-erzeugen/">Konvertierungsanleitung</a> aus  der entsprechenden Schema-Datei von eGroupware (phpgwapi/doc/ldap/rfc2307bis.schema) erzeugen oder aber von hier kopieren</p>

<div class="wp_syntax"><div class="code"><pre class="ldif" style="font-family:monospace;">dn: cn=rfc2307bis,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: rfc2307bis
olcAttributeTypes: ( 1.3.6.1.1.1.1.2 NAME 'gecos' DESC 'The GECOS field; the common name' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.3 NAME 'homeDirectory' DESC 'The absolute path to the home directory' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.4 NAME 'loginShell' DESC 'The path to the login shell' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.5 NAME 'shadowLastChange' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.6 NAME 'shadowMin' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.7 NAME 'shadowMax' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.8 NAME 'shadowWarning' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.9 NAME 'shadowInactive' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.10 NAME 'shadowExpire' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.11 NAME 'shadowFlag' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.12 NAME 'memberUid' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
olcAttributeTypes: ( 1.3.6.1.1.1.1.13 NAME 'memberNisNetgroup' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
olcAttributeTypes: ( 1.3.6.1.1.1.1.14 NAME 'nisNetgroupTriple' DESC 'Netgroup triple' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
olcAttributeTypes: ( 1.3.6.1.1.1.1.15 NAME 'ipServicePort' DESC 'Service port number' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.16 NAME 'ipServiceProtocol' DESC 'Service protocol name' SUP name )
olcAttributeTypes: ( 1.3.6.1.1.1.1.17 NAME 'ipProtocolNumber' DESC 'IP protocol number' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.18 NAME 'oncRpcNumber' DESC 'ONC RPC number' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.19 NAME 'ipHostNumber' DESC 'IPv4 addresses as a dotted decimal omitting leading        zeros or IPv6 addresses as defined in RFC2373' SUP name )
olcAttributeTypes: ( 1.3.6.1.1.1.1.20 NAME 'ipNetworkNumber' DESC 'IP network as a dotted decimal, eg. 192.168,        omitting leading zeros' SUP name SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.21 NAME 'ipNetmaskNumber' DESC 'IP netmask as a dotted decimal, eg. 255.255.255.0,        omitting leading zeros' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.22 NAME 'macAddress' DESC 'MAC address in maximal, colon separated hex        notation, eg. 00:00:92:90:ee:e2' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
olcAttributeTypes: ( 1.3.6.1.1.1.1.23 NAME 'bootParameter' DESC 'rpc.bootparamd parameter' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
olcAttributeTypes: ( 1.3.6.1.1.1.1.24 NAME 'bootFile' DESC 'Boot image name' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
olcAttributeTypes: ( 1.3.6.1.1.1.1.26 NAME 'nisMapName' DESC 'Name of a A generic NIS map' SUP name )
olcAttributeTypes: ( 1.3.6.1.1.1.1.27 NAME 'nisMapEntry' DESC 'A generic NIS entry' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.28 NAME 'nisPublicKey' DESC 'NIS public key' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.29 NAME 'nisSecretKey' DESC 'NIS secret key' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.30 NAME 'nisDomain' DESC 'NIS domain' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
olcAttributeTypes: ( 1.3.6.1.1.1.1.31 NAME 'automountMapName' DESC 'automount Map Name' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.32 NAME 'automountKey' DESC 'Automount Key value' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.1.1.1.33 NAME 'automountInformation' DESC 'Automount information' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
olcObjectClasses: ( 1.3.6.1.1.1.2.0 NAME 'posixAccount' DESC 'Abstraction of an account with POSIX attributes' SUP top AUXILIARY MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory ) MAY ( userPassword $ loginShell $ gecos $ description ) )
olcObjectClasses: ( 1.3.6.1.1.1.2.1 NAME 'shadowAccount' DESC 'Additional attributes for shadow passwords' SUP top AUXILIARY MUST uid MAY ( userPassword $ description $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag ) )
olcObjectClasses: ( 1.3.6.1.1.1.2.2 NAME 'posixGroup' DESC 'Abstraction of a group of accounts' SUP top AUXILIARY MUST gidNumber MAY ( userPassword $ memberUid $ description ) )
olcObjectClasses: ( 1.3.6.1.1.1.2.3 NAME 'ipService' DESC 'Abstraction an Internet Protocol service.        Maps an IP port and protocol (such as tcp or udp)        to one or more names; the distinguished value of        the cn attribute denotes the services canonical        name' SUP top STRUCTURAL MUST ( cn $ ipServicePort $ ipServiceProtocol ) MAY description )
olcObjectClasses: ( 1.3.6.1.1.1.2.4 NAME 'ipProtocol' DESC 'Abstraction of an IP protocol. Maps a protocol number        to one or more names. The distinguished value of the cn        attribute denotes the protocols canonical name' SUP top STRUCTURAL MUST ( cn $ ipProtocolNumber ) MAY description )
olcObjectClasses: ( 1.3.6.1.1.1.2.5 NAME 'oncRpc' DESC 'Abstraction of an Open Network Computing (ONC)       [RFC1057] Remote Procedure Call (RPC) binding.       This class maps an ONC RPC number to a name.       The distinguished value of the cn attribute denotes       the RPC services canonical name' SUP top STRUCTURAL MUST ( cn $ oncRpcNumber ) MAY description )
olcObjectClasses: ( 1.3.6.1.1.1.2.6 NAME 'ipHost' DESC 'Abstraction of a host, an IP device. The distinguished        value of the cn attribute denotes the hosts canonical        name. Device SHOULD be used as a structural class' SUP top AUXILIARY MUST ( cn $ ipHostNumber ) MAY ( userPassword $ l $ description $ manager ) )
olcObjectClasses: ( 1.3.6.1.1.1.2.7 NAME 'ipNetwork' DESC 'Abstraction of a network. The distinguished value of        the cn attribute denotes the networks canonical name' SUP top STRUCTURAL MUST ipNetworkNumber MAY ( cn $ ipNetmaskNumber $ l $ description $ manager ) )
olcObjectClasses: ( 1.3.6.1.1.1.2.8 NAME 'nisNetgroup' DESC 'Abstraction of a netgroup. May refer to other netgroups' SUP top STRUCTURAL MUST cn MAY ( nisNetgroupTriple $ memberNisNetgroup $ description ) )
olcObjectClasses: ( 1.3.6.1.1.1.2.9 NAME 'nisMap' DESC 'A generic abstraction of a NIS map' SUP top STRUCTURAL MUST nisMapName MAY description )
olcObjectClasses: ( 1.3.6.1.1.1.2.10 NAME 'nisObject' DESC 'An entry in a NIS map' SUP top STRUCTURAL MUST ( cn $ nisMapEntry $ nisMapName ) MAY description )
olcObjectClasses: ( 1.3.6.1.1.1.2.11 NAME 'ieee802Device' DESC 'A device with a MAC address; device SHOULD be        used as a structural class' SUP top AUXILIARY MAY macAddress )
olcObjectClasses: ( 1.3.6.1.1.1.2.12 NAME 'bootableDevice' DESC 'A device with boot parameters; device SHOULD be        used as a structural class' SUP top AUXILIARY MAY ( bootFile $ bootParameter ) )
olcObjectClasses: ( 1.3.6.1.1.1.2.14 NAME 'nisKeyObject' DESC 'An object with a public and secret key' SUP top AUXILIARY MUST ( cn $ nisPublicKey $ nisSecretKey ) MAY ( uidNumber $ description ) )
olcObjectClasses: ( 1.3.6.1.1.1.2.15 NAME 'nisDomainObject' DESC 'Associates a NIS domain with a naming context' SUP top AUXILIARY MUST nisDomain )
olcObjectClasses: ( 1.3.6.1.1.1.2.16 NAME 'automountMap' SUP top STRUCTURAL MUST automountMapName MAY description )
olcObjectClasses: ( 1.3.6.1.1.1.2.17 NAME 'automount' DESC 'Automount information' SUP top STRUCTURAL MUST ( automountKey $ automountInformation ) MAY description )
olcObjectClasses: ( 1.3.6.1.4.1.5322.13.1.1 NAME 'namedObject' SUP top STRUCTURAL MAY cn )</pre></div></div>

<p>Entsprechendes gilt auch für die samba.ldif, die ich mir aus der /etc/openldap/schema/samba.schema erzeugt habe (diese Datei wird erzeugt, wenn man mit samba installiert). Hier ist ihr Inhalt aufgeführt:</p>

<div class="wp_syntax"><div class="code"><pre class="ldif" style="font-family:monospace;">dn: cn=samba,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: samba
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.24 NAME 'sambaLMPassword' DESC 'LanManager Password' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.25 NAME 'sambaNTPassword' DESC 'MD4 hash of the unicode password' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.26 NAME 'sambaAcctFlags' DESC 'Account Flags' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.27 NAME 'sambaPwdLastSet' DESC 'Timestamp of the last password update' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.28 NAME 'sambaPwdCanChange' DESC 'Timestamp of when the user is allowed to update the password' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.29 NAME 'sambaPwdMustChange' DESC 'Timestamp of when the password will expire' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.30 NAME 'sambaLogonTime' DESC 'Timestamp of last logon' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.31 NAME 'sambaLogoffTime' DESC 'Timestamp of last logoff' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.32 NAME 'sambaKickoffTime' DESC 'Timestamp of when the user will be logged off automatically' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.48 NAME 'sambaBadPasswordCount' DESC 'Bad password attempt count' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.49 NAME 'sambaBadPasswordTime' DESC 'Time of the last bad password attempt' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.55 NAME 'sambaLogonHours' DESC 'Logon Hours' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{42} SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.33 NAME 'sambaHomeDrive' DESC 'Driver letter of home directory mapping' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{4} SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.34 NAME 'sambaLogonScript' DESC 'Logon script path' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.35 NAME 'sambaProfilePath' DESC 'Roaming profile path' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.36 NAME 'sambaUserWorkstations' DESC 'List of user workstations the user is allowed to logon to' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.37 NAME 'sambaHomePath' DESC 'Home directory UNC path' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.38 NAME 'sambaDomainName' DESC 'Windows NT domain to which the user belongs' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.47 NAME 'sambaMungedDial' DESC 'Base64 encoded user parameter string' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1050} )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.54 NAME 'sambaPasswordHistory' DESC 'Concatenated MD5 hashes of the salted NT passwords used on this account' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.20 NAME 'sambaSID' DESC 'Security ID' EQUALITY caseIgnoreIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64} SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.23 NAME 'sambaPrimaryGroupSID' DESC 'Primary Group Security ID' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64} SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.51 NAME 'sambaSIDList' DESC 'Security ID List' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64} )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.19 NAME 'sambaGroupType' DESC 'NT Group Type' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.21 NAME 'sambaNextUserRid' DESC 'Next NT rid to give our for users' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.22 NAME 'sambaNextGroupRid' DESC 'Next NT rid to give out for groups' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.39 NAME 'sambaNextRid' DESC 'Next NT rid to give out for anything' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.40 NAME 'sambaAlgorithmicRidBase' DESC 'Base at which the samba RID generation algorithm should operate' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.41 NAME 'sambaShareName' DESC 'Share Name' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.42 NAME 'sambaOptionName' DESC 'Option Name' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.43 NAME 'sambaBoolOption' DESC 'A boolean option' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.44 NAME 'sambaIntegerOption' DESC 'An integer option' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.45 NAME 'sambaStringOption' DESC 'A string option' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.46 NAME 'sambaStringListOption' DESC 'A string list option' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.53 NAME 'sambaTrustFlags' DESC 'Trust Password Flags' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.58 NAME 'sambaMinPwdLength' DESC 'Minimal password length (default: 5)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.59 NAME 'sambaPwdHistoryLength' DESC 'Length of Password History Entries (default: 0 =&gt; off)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.60 NAME 'sambaLogonToChgPwd' DESC 'Force Users to logon for password change (default: 0 =&gt; off, 2 =&gt; on)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.61 NAME 'sambaMaxPwdAge' DESC 'Maximum password age, in seconds (default: -1 =&gt; never expire passwords)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.62 NAME 'sambaMinPwdAge' DESC 'Minimum password age, in seconds (default: 0 =&gt; allow immediate password change)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.63 NAME 'sambaLockoutDuration' DESC 'Lockout duration in minutes (default: 30, -1 =&gt; forever)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.64 NAME 'sambaLockoutObservationWindow' DESC 'Reset time after lockout in minutes (default: 30)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.65 NAME 'sambaLockoutThreshold' DESC 'Lockout users after bad logon attempts (default: 0 =&gt; off)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.66 NAME 'sambaForceLogoff' DESC 'Disconnect Users outside logon hours (default: -1 =&gt; off, 0 =&gt; on)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.7165.2.1.67 NAME 'sambaRefuseMachinePwdChange' DESC 'Allow Machine Password changes (default: 0 =&gt; off)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
olcObjectClasses: ( 1.3.6.1.4.1.7165.2.2.6 NAME 'sambaSamAccount' DESC 'Samba 3.0 Auxilary SAM Account' SUP top AUXILIARY MUST ( uid $ sambaSID ) MAY ( cn $ sambaLMPassword $ sambaNTPassword $ sambaPwdLastSet $ sambaLogonTime $ sambaLogoffTime $ sambaKickoffTime $ sambaPwdCanChange $ sambaPwdMustChange $ sambaAcctFlags $ displayName $ sambaHomePath $ sambaHomeDrive $ sambaLogonScript $ sambaProfilePath $ description $ sambaUserWorkstations $ sambaPrimaryGroupSID $ sambaDomainName $ sambaMungedDial $ sambaBadPasswordCount $ sambaBadPasswordTime $ sambaPasswordHistory $ sambaLogonHours ) )
olcObjectClasses: ( 1.3.6.1.4.1.7165.2.2.4 NAME 'sambaGroupMapping' DESC 'Samba Group Mapping' SUP top AUXILIARY MUST ( gidNumber $ sambaSID $ sambaGroupType ) MAY ( displayName $ description $ sambaSIDList ) )
olcObjectClasses: ( 1.3.6.1.4.1.7165.2.2.14 NAME 'sambaTrustPassword' DESC 'Samba Trust Password' SUP top STRUCTURAL MUST ( sambaDomainName $ sambaNTPassword $ sambaTrustFlags ) MAY ( sambaSID $ sambaPwdLastSet ) )
olcObjectClasses: ( 1.3.6.1.4.1.7165.2.2.15 NAME 'sambaTrustedDomainPassword' DESC 'Samba Trusted Domain Password' SUP top STRUCTURAL MUST ( sambaDomainName $ sambaSID $ sambaNTPassword $ sambaPwdLastSet ) )
olcObjectClasses: ( 1.3.6.1.4.1.7165.2.2.5 NAME 'sambaDomain' DESC 'Samba Domain Information' SUP top STRUCTURAL MUST ( sambaDomainName $ sambaSID ) MAY ( sambaNextRid $ sambaNextGroupRid $ sambaNextUserRid $ sambaAlgorithmicRidBase $ sambaMinPwdLength $ sambaPwdHistoryLength $ sambaLogonToChgPwd $ sambaMaxPwdAge $ sambaMinPwdAge $ sambaLockoutDuration $ sambaLockoutObservationWindow $ sambaLockoutThreshold $ sambaForceLogoff $ sambaRefuseMachinePwdChange ) )
olcObjectClasses: ( 1.3.6.1.4.1.7165.2.2.7 NAME 'sambaUnixIdPool' DESC 'Pool for allocating UNIX uids/gids' SUP top AUXILIARY MUST ( uidNumber $ gidNumber ) )
olcObjectClasses: ( 1.3.6.1.4.1.7165.2.2.8 NAME 'sambaIdmapEntry' DESC 'Mapping from a SID to an ID' SUP top AUXILIARY MUST sambaSID MAY ( uidNumber $ gidNumber ) )
olcObjectClasses: ( 1.3.6.1.4.1.7165.2.2.9 NAME 'sambaSidEntry' DESC 'Structural Class for a SID' SUP top STRUCTURAL MUST sambaSID )
olcObjectClasses: ( 1.3.6.1.4.1.7165.2.2.10 NAME 'sambaConfig' DESC 'Samba Configuration Section' SUP top AUXILIARY MAY description )
olcObjectClasses: ( 1.3.6.1.4.1.7165.2.2.11 NAME 'sambaShare' DESC 'Samba Share Section' SUP top STRUCTURAL MUST sambaShareName MAY description )
olcObjectClasses: ( 1.3.6.1.4.1.7165.2.2.12 NAME 'sambaConfigOption' DESC 'Samba Configuration Option' SUP top STRUCTURAL MUST sambaOptionName MAY ( sambaBoolOption $ sambaIntegerOption $ sambaStringOption $ sambaStringListoption $ description ) )</pre></div></div>

<p>Der nächste Schritt kann übersprungen werden, falls man nicht meinem Mailserversetup folgen möchte: Wir fügen die in  meinem <a href="http://www.effinger.org/blog/2009/03/22/dovecot-exim-openldap-und-getmail-unter-ubuntu-1-openldap/">anderen  Artikel</a> aufgeführten Schemas  <span style="text-decoration: underline;">dyngroup.schema.ldif</span> und <span style="text-decoration: underline;">dovecot.schema.ldif</span> hinzu (siehe  dort).</p>
<p>Darüber hinaus erstellen wir den Eintrag für die Module, die geladen werden sollen und die Aktivierung der Module. Dazu erzeugen wir die Datei module_basis.ldif mit dem Inhalt</p>

<div class="wp_syntax"><div class="code"><pre class="ldif" style="font-family:monospace;">dn: cn=module,cn=config
objectclass: olcModuleList
cn: module
olcModulePath: /usr/lib/openldap/openldap</pre></div></div>

<p>und die Datei module_load.ldif mit dem Inhalt</p>

<div class="wp_syntax"><div class="code"><pre class="ldif" style="font-family:monospace;">dn: cn=module{0},cn=config
changetype: modify
add: olcModuleLoad
olcModuleLoad: dynlist.so
olcModuleLoad: accesslog.so</pre></div></div>

<p>Dann fügen wir den Inhalt cn=config hinzu mit</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ldapadd <span style="color: #660033;">-D</span> <span style="color: #ff0000;">&quot;cn=config&quot;</span> <span style="color: #660033;">-x</span> <span style="color: #660033;">-W</span> <span style="color: #660033;">-f</span> module_basis.ldif
ldapmodify <span style="color: #660033;">-D</span> <span style="color: #ff0000;">&quot;cn=config&quot;</span> <span style="color: #660033;">-x</span> <span style="color: #660033;">-W</span> <span style="color: #660033;">-f</span> module_load.ldif</pre></div></div>

<h3>Festlegen der Basisstruktur des LDAP-Verzeichnises und Eintrag bestehender Daten</h3>
<p>Nun können wir die Grundstruktur der Daten ergänzen. Dazu erzeugen wir wieder eine LDIF-Datei namens data.ldif mit dem Inhalt</p>

<div class="wp_syntax"><div class="code"><pre class="ldif" style="font-family:monospace;">dn: dc=effinger,dc=org
objectClass: dcObject
objectClass: organization
dc: effinger
o: effinger
&nbsp;
dn: o=default,dc=effinger,dc=org
objectClass: organization
objectClass: top
o: default
&nbsp;
dn: ou=accounts,o=default,dc=effinger,dc=org
objectClass: organizationalUnit
objectClass: top
ou: accounts
&nbsp;
dn: ou=groups,o=default,dc=effinger,dc=org
objectClass: organizationalUnit
objectClass: top
ou: groups
&nbsp;
dn: ou=machines,o=default,dc=effinger,dc=org
objectClass: organizationalUnit
objectClass: top
ou: machines
&nbsp;
dn: ou=contacts,o=default,dc=effinger,dc=org
objectClass: organizationalUnit
objectClass: top
ou: contacts</pre></div></div>

<p>und fügen Sie dem Verzeichnis durch den Befehl</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ldapadd <span style="color: #660033;">-D</span> <span style="color: #ff0000;">&quot;cn=admin,dc=effinger,dc=org&quot;</span> <span style="color: #660033;">-x</span> <span style="color: #660033;">-W</span> <span style="color: #660033;">-f</span> data.ldif</pre></div></div>

<p>hinzu. Ganz wichtig ist übrigens, dass die <strong>Passwörter mit dem CRYPT-Algorithmus</strong> gehasht sind, denn ansonsten schlägt das Modul pam_unix fehl und man kann sich nicht einloggen. Also vorher bitte sicherstellen, dass die Passwörter mit dem Befehl</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">slappasswd <span style="color: #660033;">-h</span> <span style="color: #ff0000;">&quot;{CRYPT}&quot;</span></pre></div></div>

<p>erzeugt werden. Diese Information stammt aus dem <a href="http://www.brandonhutchinson.com/wiki/Pam_unix_vs._pam_ldap">Wiki-Artikel von Brandon Hutchinson</a>.</p>
<h3>Einrichten des Systems für die Authentifizierung mit LDAP</h3>
<p>Wir installieren pam_ldap und nss_ldap mit einem</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">emerge pam_ldap nss_ldap</pre></div></div>

<p>Damit pam und nss LDAP zur Authentifizierung verwendet, müssen verschiedene Dateien angepasst werden. Die folgende Beschreibung orientiert sich dabei an der <a href="http://www.gentoo.org/doc/en/ldap-howto.xml#doc_chap3">Gentoo-Dokumentation</a>. Wir beginnen mit /etc/ldap.conf, die von pam_ldap und nss_ldap verwendet wird. Im Gegensatz dazu  lesen OpenLDAP und dessen Bibliotheken d/etc/openldap/ldap.conf aus, welche &#8211; falls wir das weiter oben nicht schon getan hätten &#8211; auch angepasst werden müsste. Bei mir sieht die Datei /etc/ldap.conf nun folgendermaßen aus:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">uri ldapi:<span style="color: #000000; font-weight: bold;">//%</span>2fvar<span style="color: #000000; font-weight: bold;">%</span>2frun<span style="color: #000000; font-weight: bold;">%</span>2fopenldap<span style="color: #000000; font-weight: bold;">%</span>2fslapd.sock
ldap_version <span style="color: #000000;">3</span>
scope one
pam_filter <span style="color: #007800;">objectclass</span>=posixAccount
pam_login_attribute uid
pam_member_attribute memberuid
pam_password exop
nss_base_passwd <span style="color: #007800;">ou</span>=accounts,<span style="color: #007800;">o</span>=default,<span style="color: #007800;">dc</span>=effinger,<span style="color: #007800;">dc</span>=org?one
nss_base_shadow <span style="color: #007800;">ou</span>=accounts,<span style="color: #007800;">o</span>=default,<span style="color: #007800;">dc</span>=effinger,<span style="color: #007800;">dc</span>=org?one
nss_base_group  <span style="color: #007800;">ou</span>=<span style="color: #c20cb9; font-weight: bold;">groups</span>,<span style="color: #007800;">o</span>=default,<span style="color: #007800;">dc</span>=effinger,<span style="color: #007800;">dc</span>=org?one
nss_base_hosts  <span style="color: #007800;">ou</span>=machines,<span style="color: #007800;">o</span>=default,<span style="color: #007800;">dc</span>=effinger,<span style="color: #007800;">dc</span>=org?one
nss_reconnect_tries <span style="color: #000000;">4</span>                   <span style="color: #666666; font-style: italic;"># number of times to double the sleep time</span>
nss_reconnect_sleeptime <span style="color: #000000;">1</span>               <span style="color: #666666; font-style: italic;"># initial sleep value</span>
nss_reconnect_maxsleeptime <span style="color: #000000;">16</span>   <span style="color: #666666; font-style: italic;"># max sleep value to cap at</span>
nss_reconnect_maxconntries <span style="color: #000000;">2</span>    <span style="color: #666666; font-style: italic;"># how many tries before sleeping</span></pre></div></div>

<p>Nun passen wir noch die Datei /etc/pam.d/system-auth an</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">auth            required        pam_env.so
auth            sufficient      pam_unix.so try_first_pass likeauth nullok
auth            sufficient      pam_ldap.so use_first_pass
auth            required        pam_deny.so
&nbsp;
account         sufficient      pam_ldap.so
account         required        pam_unix.so
&nbsp;
password        required        pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
password        sufficient      pam_unix.so try_first_pass use_authtok nullok sha512 shadow
password        sufficient      pam_ldap.so use_authtok use_first_pass
password        required        pam_deny.so
&nbsp;
session         required        pam_limits.so
session         required        pam_env.so
session         required        pam_unix.so
session         optional        pam_permit.so
session         optional        pam_ldap.so</pre></div></div>

<p>Ich musste hier alle Zeilen mit pam_ldap ergänzen. Bitte dabei unbedingt die gleiche Reihenfolge der Module beibehalten. Als letztes passen wir noch /etc/nsswitch.conf an (in den aufgeführten drei Zeilen hinten das Wort ldap ergänzen):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">passwd</span>:      compat ldap
shadow:      compat ldap
group:       compat ldap</pre></div></div>

<p>Damit sind wir fertig. Falls ein Benutzeraccount unter ou=accounts,o=default,dc=effinger,dc=org existiert, sollte er nach dem Aufruf von</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gentent <span style="color: #c20cb9; font-weight: bold;">passwd</span></pre></div></div>

<p>aufgeführt werden. Für Benutzergruppen gibt es den analogen Befehl</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gentent group</pre></div></div>

<p>Zum Schluss möchte ich noch anmerken, dass man LDAP damit auch als zentralen Server zur Benutzerauthentifizierung einsetzen kann. Dazu muss auf den Clients selbstverständlich die LDAP-URL vom obigen Beispiel angepasst werden, da sie hier ja auf einen lokalen Unix-Socket verweist.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.effinger.org/blog/2010/05/08/openldap-fur-pam_ldap-nss_ldap-unter-gentoo-im-schnelldurchgang-einrichten/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Erfahrungen mit Gentoo auf Linux-VServer</title>
		<link>http://www.effinger.org/blog/2010/03/15/erfahrungen-mit-gentoo-auf-linux-vserver/</link>
		<comments>http://www.effinger.org/blog/2010/03/15/erfahrungen-mit-gentoo-auf-linux-vserver/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 20:33:30 +0000</pubDate>
		<dc:creator>Markus Effinger</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux-VServer]]></category>

		<guid isPermaLink="false">http://www.effinger.org/blog/?p=1001</guid>
		<description><![CDATA[<p>Nachdem ich mittlerweile bei dem attraktiven Angebot von netcup zugegriffen habe, bin ich stolzer Besitzer eines Linux-VServers. Schon länger spiele ich mit dem Gedanken, mal eine andere Distributionslinie als Debian/Ubuntu &#38; Co auszuprobieren und nun bin ich untreu geworden. Auf meinem VServer läuft Gentoo. Leider war Gentoo nicht als vorinstalliertes Image verfügbar (@netcup: hier besteht [...]]]></description>
			<content:encoded><![CDATA[<p>Nachdem ich mittlerweile bei dem <a href="http://www.netcup.de/vserver/">attraktiven Angebot</a> von <a href="http://www.hostblog.eu/">netcup</a> zugegriffen habe, bin ich stolzer Besitzer eines Linux-VServers. Schon länger spiele ich mit dem Gedanken, mal eine andere Distributionslinie als Debian/Ubuntu &amp; Co auszuprobieren und nun bin ich untreu geworden. Auf meinem VServer läuft <a href="http://www.gentoo.de/">Gentoo</a>. Leider war Gentoo nicht als vorinstalliertes Image verfügbar (@netcup:  hier besteht noch Verbesserungspotential), aber dank der <a href="http://mark.ossdl.de/2010/02/gentoo-on-a-linux-vserver-partition-with-wrong-initstyle/">Anleitung von Mark</a> habe ich die Installation auch so geschafft (siehe auch <a href="http://mark.ossdl.de/2010/02/gentoo-on-a-linux-vserver-partition-with-wrong-initstyle/comment-page-1/#comment-8525">mein Kommentar</a> dort). Soweit lief alles einwandfrei!</p>
<h3>Neustarten des Linux-VServers mit Gentoo</h3>
<p>Ein kleines Problem hatte ich mit dem Neustart des Systems. Ein einfaches</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">reboot</pre></div></div>

<p>half da nicht weiter, denn es trat die folgende Fehlermeldung auf</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">init: timeout opening/writing control channel /dev/initctl</pre></div></div>

<p>mit der Folge, dass das System nicht neu startete. Der Hintergrund dieser Fehlermeldung ist, dass unter Linux-VServer kein reguläres init-System läuft &#8211; eine <a href="http://www.mail-archive.com/vserver@list.linux-vserver.org/msg09755.html">detailliertere Beschreibung findet sich in der Mailingliste</a>. Aus diesem Grund ist für einen Neustart ein</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">reboot <span style="color: #660033;">-f</span></pre></div></div>

<p>erforderlich, wie es auch <a href="http://thenthdoctor.blogspot.com/2007/03/timeout-openingwriting-control-channel.html">Nathan Hawks erklärt</a>.</p>
<h3>Festlegen des Domainnamens auf dem Gentoo-System</h3>
<p>Ich habe mich etwas abgemüht, den Domainnamen des Systems festzulegen. Die Ausgabe von</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">hostname</span> <span style="color: #660033;">--fqdn</span></pre></div></div>

<p>ergab stets</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">hostname: Unbekannter Rechner</pre></div></div>

<p>Auch die Änderung der Datei /etc/hosts von</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">127.0.0.1       localhost</pre></div></div>

<p>auf</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">127.0.0.1       myserver.mydomain.tld  localhost</pre></div></div>

<p>führte nicht zum gewünschten Erfolg. Ebenso wirkungslos blieb die Änderung von dns_domain_lo in der Datei /etc/conf.d/net. Erst als ich die IP-Adresse von eth0 und den Hostnamen auch noch in /etc/hosts nach dem Schema</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">xx.xx.xx.xx       myserver.mydomain.tld</pre></div></div>

<p>eingetragen hatte, funktionierte es. Darauf kam ich aber erst durch einen <a href="http://forum.soft32.com/linux/gentoo-Domainname-ftopict333490.html">Forumsbeitrag</a> mit dem gleichen Problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.effinger.org/blog/2010/03/15/erfahrungen-mit-gentoo-auf-linux-vserver/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

