Current time: 06-24-2024, 09:58 PM Hello There, Guest! (LoginRegister)


Post Reply 
postfix: fatal: unknown service: smtp/tcp
Author Message
mdages Offline
Junior Member
*

Posts: 15
Joined: Apr 2008
Reputation: 0
Post: #1
postfix: fatal: unknown service: smtp/tcp
Da mich die Boardsuche zu dem Thema nicht weiterbringt, möchte ich gerne folgendes Problem vorbringen.

Mein postfix gibt in /var/log/mail die Fehlermeldung:
Code:
Apr 15 19:21:49 avkxen1 postfix/master[31890]: daemon started -- version 2.4.5, configuration /etc/postfix
Apr 15 19:21:50 avkxen1 postfix/smtp[31912]: fatal: unknown service: smtp/tcp

Das System ist ein frisch, minimal installiertes OpenSuse-10.3 System.
Zuvor hatte ich das gleiche Problem mit OpenSuse-10.2 und da ich es nicht hin bekommen habe, habe ich mal eben eine frische 10.3er Installation drauf gespielt. Nach Anleitung habe ich ispCP dann installiert. Sonst habe ich auf dem System nichts eingerichetet. Einfach nur ein nacktes OpenSuse-10.3 und der Nightly-Build von ispCP vom 11.04.
ispCP funktioniert ansätzlich, zumindest kann ich mich fehlerfrei als admin einloggen.

Die Hinweise in diesem Board, die /etc/services Datei nach /var/spool/postfix/etc oder nach /var/spool/mail/virtual zu kopieren habe ich schon befolgt, ohne Erfolg.
Habe auch versucht die jeweils kopierte services Datei unter den Owner postfix zu stellen, hat aber auch nichts gebracht.

Achja, die services Datei enthält natürlich den smtp Dienst:
Code:
avkxen1:~ # grep smtp /etc/services
smtp             25/tcp    mail         # Simple Mail Transfer
smtp             25/udp    mail         # Simple Mail Transfer
smtps           465/tcp    # eMail Server
#                         Boris B. Maiden <Boris_Maiden@smtp.microcom.com>
rsmtp           2390/tcp   # RSMTP
rsmtp           2390/udp   # RSMTP

Hier mal die main.cf aus /etc/postfix
Code:
#
# ispCP Ï (OMEGA) a Virtual Hosting Control System
#
# @copyright    2001-2006 by moleSoftware GmbH
# @copyright    2006-2008 by ispCP | http://isp-control.net
# @version              SVN: $ID$
# @link                 http://isp-control.net
# @author               ispCP Team
#
# @license
#   This program is free software; you can redistribute it and/or modify it under
#   the terms of the MPL General Public License as published by the Free Software
#   Foundation; either version 1.1 of the License, or (at your option) any later
#   version.
#   You should have received a copy of the MPL Mozilla Public License along with
#   this program; if not, write to the Open Source Initiative (OSI)
#   http://opensource.org | osi@opensource.org
#
################################################################################​

# Postfix directory settings; These are critical for normal Postfix MTA functionallity
command_directory            = /usr/sbin
daemon_directory             = /usr/lib/postfix
program_directory            = /usr/lib/postfix

# Some common configuration parameters
inet_interfaces              = all
mynetworks_style             = host

myhostname                   = avkxen1.avk-edv.de
mydomain                     = avkxen1.avk-edv.de.local
myorigin                     = $myhostname

smtpd_banner                 = $myhostname ESMTP ispCP 1.0.0 RC5 OMEGA Managed
setgid_group                 = maildrop

# Receiving messages parameters
mydestination                = $myhostname, $mydomain
append_dot_mydomain          = no
append_at_myorigin           = yes
local_transport              = local
virtual_transport            = virtual
transport_maps               = hash:/etc/postfix/ispcp/transport
alias_maps                   = hash:/etc/aliases
alias_database               = hash:/etc/aliases

# Delivering local messages parameters
mail_spool_directory         = /var/spool/mail

# Mailboxquota
# => 0 for unlimited
# => 104857600 for 100 MB
mailbox_size_limit           = 0
mailbox_command              = procmail -a "$EXTENSION"

biff                         = no
recipient_delimiter          = +

local_destination_recipient_limit = 1
local_recipient_maps         = unix:passwd.byname $alias_database

# ispCP Autoresponder parameters
ispcp-arpl_destination_recipient_limit = 1

# Delivering virtual messages parameters
virtual_mailbox_base         = /var/spool/mail/virtual
virtual_mailbox_limit        = 0

virtual_mailbox_domains      = hash:/etc/postfix/ispcp/domains
virtual_mailbox_maps         = hash:/etc/postfix/ispcp/mailboxes

virtual_alias_maps           = hash:/etc/postfix/ispcp/aliases

virtual_minimum_uid          = 1001
virtual_uid_maps             = static:1001
virtual_gid_maps             = static:12

# SASL paramters
smtpd_sasl_auth_enable       = yes
smtpd_sasl2_auth_enable      = yes
smtpd_sasl_security_options  = noanonymous
smtpd_sasl_local_domain      =
broken_sasl_auth_clients     = yes

smtpd_helo_required          = yes

smtpd_helo_restrictions      = permit_mynetworks,
                               permit_sasl_authenticated,
                               reject_invalid_helo_hostname,
                               reject_non_fqdn_helo_hostname

smtpd_sender_restrictions    = reject_non_fqdn_sender,
                               reject_unknown_sender_domain,
                               permit_mynetworks,
                               permit_sasl_authenticated

smtpd_recipient_restrictions = reject_non_fqdn_recipient,
                               reject_unknown_recipient_domain,
                               permit_mynetworks,
                               permit_sasl_authenticated,
                               reject_unauth_destination,
                               reject_unlisted_recipient,
                               check_policy_service inet:127.0.0.1:12525,
                               check_policy_service inet:127.0.0.1:60000,
                               permit

smtpd_data_restrictions      = reject_multi_recipient_bounce,
                               reject_unauth_pipelining

# TLS parameters; activate, if avaible/used
#smtpd_use_tls               = yes
#smtpd_tls_loglevel          = 2
#smtpd_tls_cert_file         = /etc/postfix/cert.pem
#smtpd_tls_key_file          = /etc/postfix/privkey.pem
#smtpd_tls_auth_only         = no
#smtpd_tls_received_header   = yes

# AMaViS parameters; activate, if available/used
#content_filter               = amavis:[127.0.0.1]:10024

# Quota support; activate, if available/used
#virtual_create_maildirsize     = yes
#virtual_mailbox_extended       = yes
#virtual_mailbox_limit_maps     = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
#virtual_mailbox_limit_override = yes
#virtual_maildir_limit_message  = "The user you're trying to reach is over mailbox quota."
#virtual_overquota_bounce       = yes

Das ganze läuft nur auf einem Testsystem unter einer Xen-Instanz und dient ausschliesslich nur dem Test von ispCP unter OpenSuse.
Da ich die Probleme unter Debian-4 bislang nicht hatte, vermute ich einen Zusammenhang mit dem Suse System.

Any ideas?

Gruss
Markus
04-16-2008 01:35 AM
Find all posts by this user Quote this message in a reply
mdages Offline
Junior Member
*

Posts: 15
Joined: Apr 2008
Reputation: 0
Post: #2
RE: postfix: fatal: unknown service: smtp/tcp
Das ganze hat mir keine Ruhe gelassen und ich habe weiter gesucht und gesucht... Smile

Habe es jetzt auch hin bekommen.

Postfix läuft in einer chrooted Umgebung, dass war bei mir per Default so eingestellt. Vermutlich durch die Installation von ispCP.
Habe ich diese chrooted Umgebung abgestellt, ging es. Also war mir klar, es muss an der chrooted Umgebung liegen und egal wie und wo man googelt, es läuft immer darauf hinaus, dass da dann wohl zusätzliche Dateien unter /var/spool/postfix nötig sind.
Auch die Boardsuche hier hat das ja schon aufgegriffen und man liest Tipps, die /etc/services Datei nach /var/spool/postfix/etc/services zu kopieren.
Damit allein hat es sich bei mir aber nicht getan.
Mir ist dann auch noch aufgefallen, dass die Logfile Einträge eine vollkommen falsche, vom System abweichende, Uhrzeit haben.
Also habe ich mal die /etc/localtime nach /var/spool/postfix/etc/localtime kopiert. Das brachte dann zumindest mal die richtigen Zeitstempel in den mail.* Logfiles.

Dann habe ich mir mal das postfix-devel Paket per yast installiert. Damit bekommt man den Pfad /usr/share/doc/packages/postfix/examples/chroot-setup/ und darin diverse Dateien, die helfen sollen eine Postfix chrooted Umgebung einzurichten. In obigem Pfad liegt eine LINUX2 Datei. Diese habe ich einfach mal ausgeführt.

Danach fanden sich unter /var/spool/postfix/etc folgende Dateien:
Code:
avkxen1:~ # ls -l /var/spool/postfix/etc
total 736
-rw-r--r-- 1 root root    370 Sep 22  2007 host.conf
-rw-r--r-- 1 root root    310 Apr 15 15:48 hosts
-rw-r--r-- 1 root root   2295 Sep 22  2007 localtime
-rw-r--r-- 1 root root   1192 Sep 21  2007 nsswitch.conf
-rw-r--r-- 1 root root   1431 Apr 15 20:09 passwd
-rw-r--r-- 1 root root     43 Apr 15 14:54 resolv.conf
-rw-r--r-- 1 root root 723129 Sep 22  2007 services

Auch einige Libs hat er nach /var/spool/postfix/lib kopiert.
Hier der Einfachheit halber einfach mal der Inhalt der LINUX2 Datei:
Code:
#! /bin/sh

# LINUX2 - shell script to set up a Postfix chroot jail for Linux
# Tested on SuSE Linux 5.3 (libc5) and 7.0 (glibc2.1)

# Other testers reported as working:
#
# 2001-01-15 Debian sid (unstable)
#            Christian Kurz <shorty@getuid.de>

# Copyright (c) 2000 - 2001 by Matthias Andree
# Redistributable unter the MIT-style license that follows:
# Abstract: "do whatever you want except hold somebody liable or change
# the copyright information".

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

# 2000-09-29
# v0.1: initial release

# 2000-12-05
# v0.2: copy libdb.* for libnss_db.so
#       remove /etc/localtime in case it's a broken symlink
#       restrict find to maxdepth 1 (faster)

# Revision 1.4  2001/01/15 09:36:35  emma
# add note it was successfully tested on Debian sid
#
# 20060101 /lib64 support by Keith Owens.
#

CP="cp -p"

cond_copy() {
  # find files as per pattern in $1
  # if any, copy to directory $2
  dir=`dirname "$1"`
  pat=`basename "$1"`
  lr=`find "$dir" -maxdepth 1 -name "$pat"`
  if test ! -d "$2" ; then exit 1 ; fi
  if test "x$lr" != "x" ; then $CP $1 "$2" ; fi
}

set -e
umask 022

POSTFIX_DIR=${POSTFIX_DIR-/var/spool/postfix}
cd ${POSTFIX_DIR}

mkdir -p etc lib usr/lib/zoneinfo
test -d /lib64 && mkdir -p lib64

# find localtime (SuSE 5.3 does not have /etc/localtime)
lt=/etc/localtime
if test ! -f $lt ; then lt=/usr/lib/zoneinfo/localtime ; fi
if test ! -f $lt ; then lt=/usr/share/zoneinfo/localtime ; fi
if test ! -f $lt ; then echo "cannot find localtime" ; exit 1 ; fi
rm -f etc/localtime

# copy localtime and some other system files into the chroot's etc
$CP -f $lt /etc/services /etc/resolv.conf /etc/nsswitch.conf etc
$CP -f /etc/host.conf /etc/hosts /etc/passwd etc
ln -s -f /etc/localtime usr/lib/zoneinfo

# copy required libraries into the chroot
cond_copy '/lib/libnss_*.so*' lib
cond_copy '/lib/libresolv.so*' lib
cond_copy '/lib/libdb.so*' lib
if test -d /lib64; then
  cond_copy '/lib64/libnss_*.so*' lib64
  cond_copy '/lib64/libresolv.so*' lib64
  cond_copy '/lib64/libdb.so*' lib64
fi

postfix reload

Und voila, damit scheint das Problem mit dem "unkown service: smtp/tcp" nun gelöst zu sein, zumindest meckert er jetzt nicht mehr.

Eventuell macht es Sinn, dieses Script mit in die Installation von ispCP mit aufzunehmen bzw. die Vorgehensweise zu dokumentieren.

Gruss
Markus
04-16-2008 03:21 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #3
RE: postfix: fatal: unknown service: smtp/tcp
mit ein bisschen Suchen im Forum, hättest du dort auch den Grund gefunden :-)
04-16-2008 09:45 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mdages Offline
Junior Member
*

Posts: 15
Joined: Apr 2008
Reputation: 0
Post: #4
RE: postfix: fatal: unknown service: smtp/tcp
joximu Wrote:mit ein bisschen Suchen im Forum, hättest du dort auch den Grund gefunden :-)

naja, ich habe eigentlich schon gesucht.
Aber wenn man nach "unknown service: smtp" sucht, so lautet ja schliesslich die Fehlermeldung, da gab die Suche gerade mal 2 Threads zurück. Einen Grund konnte ich darin nicht wirklich finden. Auch mit anderen Suchbegriffen habe ich nichts gefunden, was mir geholfen hätte.
Alles was ich gefunden hatte war das kopieren der /etc/services Datei, aber das alleine war bei mir nicht die Lösung.

Um meine Sucheigenschaften aber in Zukunft zu verbessern, hast Du mich jetzt natürlich schon neugierig gemacht. Gerade weil ich eigentlich schon immer vorher recht viel suche bevor ich was schreibe. Ich habe zu diesem Problem wirklich recht ausgiebig, sowohl hier als auch bei google & Co., gesucht. Die meist gefundene Antwort war allerdings, das chroot auszuschalten und das ist keine Lösung.
Vielleicht suche ich also einfach nur nicht richtig und da interessiert es mich natürlich jetzt, wie Du gesucht hättest.

Ich finde, zumindest durch diesen Thread hier, findet man zu dem Problem jetzt doch einen hilfreichen Suchtreffer mehr. Smile

Gruss
Markus
04-16-2008 08:25 PM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #5
RE: postfix: fatal: unknown service: smtp/tcp
Hallo Markus

ich muss gestehen, hab die zwei Posts nur überflogen, da es ja schon gelöst war.
In der Suche hast du sicherlich "den Grund" (nämlich chroot) gefunden - das kopieren der services ist sicherlich eine der wichtigeren Dinge, aber je nach Disti brauchtas vielleicht auch mehr.

Was mich etwas seltsam vorkommt, ist, dass SuSE diese Sachen nicht selbst da rein kopiert - das hat bisher in meinen älteren SuSEs immer gut geklappt... sowohl bind wie postfix: die init Skripte haben jeweils die notwendigen Daten ins chroot kopiert...

Vielleicht hängt es damit zusammen, dass die master.cf von ispCP ersetzt wird... ggf. müsste man die Spalte "chroot?" an suse anpassen...

Hm, muss auch mal nachesehen - ich könnte mir vorstellen, dass eine Änderung in /etc/sysconfig/postfix hilft:

Ausschnitt:
Code:
## Type:        yesno
## Default:     no
## Config:      postfix
#
# Start postfix services chrooted, that are able to run chrooted?
# Note: if you want SuSEconfig to maintain the chroot jail, you
# also have to set POSTFIX_UPDATE_CHROOT_JAIL to yes
#
POSTFIX_CHROOT="yes"

## Type:        yesno
## Default:     no
## Config:      postfix
#
# Set this to yes, if SuSEconfig should setup the chroot jail itself
#
POSTFIX_UPDATE_CHROOT_JAIL="yes"

Gruss
Joxi
(This post was last modified: 04-16-2008 08:57 PM by joximu.)
04-16-2008 08:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
mdages Offline
Junior Member
*

Posts: 15
Joined: Apr 2008
Reputation: 0
Post: #6
RE: postfix: fatal: unknown service: smtp/tcp
Hi Joxi,

das es an der chrooted Umgebung liegen könnte war von Anfang an mein größter Verdacht und ich bin den Hinweisen mit der services Datei dann gefolgt. Da das aber nichts brachte, war ich verunsichert darüber, dass es nur am chroot liegen könnte. Smile

Die Variablen POSTFIX_CHROOT und POSTFIX_UPDATE_CHROOT_JAIL in /etc/sysconfig/postfix, stehen bei all meinen OpenSuse 10.2/10.3 Installationen per Default auf "no". Vermutlich kopiert deshalb suseconfig auch nicht die entsprechenden Dateien ins chroot Verzeichnis von Postfix. Auch das ispCP Setup ändert diese Variablen nicht.
Auch wenn ich unter Yast2 meinen MTA konfiguriere, habe ich bei der Standard-Konfiguration keine Möglichkeit gesehen, Postfix chrooted zu setzen.
Bei einer Standard OpenSuse Installation ist also eigentlich mehr davon auszugehen, dass Postfix noch nicht als chrooted konfiguriert ist.

Ich schau mir das aber auch nochmal mit einer neuen Installation an und setze dann einfach mal manuell die Einträge in /etc/sysconfig/postfix auf yes und schau ob das dann hilft.
Melde mich dann wieder... Smile

Gruss
Markus
04-16-2008 09:21 PM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #7
RE: postfix: fatal: unknown service: smtp/tcp
Ok, das scheint so zu sein - danke für deine Tests, das kann ich dann in die INSTALL Doku zum SuSE dazunehmen...

Gruss J
04-16-2008 09:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)