Page 1 of 1
Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-22 09:02
by mmmichael
Hallo,
hab hier Qmail mit QMAILQUEUE Patch + Spamassassin und ClamAV laufen.
Das System läuft auch wunderbar und die Mails werden, wie eingestellt, auch getaggt.
Gestartet wird alles über Daemontools (die ganzen /service/.../run Dateien).
Was mich jetzt jedoch gewaltig stört ist, dass immer irgendein clamd/spamd Prozess sekündlich <defunct>'ed und dann wahrscheinlich abschmiert und neu gestartet wird. Daher habe ich immer ordentlich Load auf der Kiste.
Dann stürzt auch noch der proftpd sekündlich ab ... Es ist also ne Menge los hier auf der Kiste :-)
Was kann das sein?
Gruss
Michael
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-22 09:29
by mmmichael
Hi,
also kleiner Nachtrag:
Sobald ich clamd / spamd / proftpd von hand starte (also aus dem /service Verzeichnis rausnehme), läuft der Server wunderbar mit 0.0 0.0 0.0.
Gruss
Michael
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-22 10:22
by kenzo
Vielleicht sollten wir jetzt Deine run-Dateien sehen.
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-22 11:18
by mmmichael
Hi,
irgendwo logisch :-).
Also:
Code: Select all
bart:/service/clamd# cat run
#!/bin/sh
#
# --------------------------------------------------
# run
#
# Purpose - Start the clamd daemon/service.
#
# Author - Jesse D. Guardiani
# Created - 09/10/03
# Modified - 09/25/03
# --------------------------------------------------
# This script is designed to be run under DJB's
# daemontools package.
#
# ChangeLog
# ---------
#
# 09/25/03 - JDG
# --------------
# - Changed clamd user to qscand in compliance with
# the change to qmail-scanner-1.20rc3
#
# 09/10/03 - JDG
# --------------
# - Created
# --------------------------------------------------
# Copyright (C) 2003 WingNET Internet Services
# Contact: Jesse D. Guardiani (jesse at wingnet dot net)
# --------------------------------------------------
lockfile="/tmp/clamd" # Location of clamd lock file
path_to_clamd="/usr/local/sbin/clamd"
# Location of the clamd binary
BAD_EXIT_CODE=1 # The exit code we use to announce that something bad has happened
# The following pipeline is designed to return the pid of each
# clamd process currently running.
get_clam_pids_pipeline=`ps -ax | grep -E "${path_to_clamd}$" | grep -v grep | awk '{print $1}'`
# --------------------------------------------------
# Generic helper functions
# --------------------------------------------------
# Basic return code error message function
die_rcode() {
EXIT_CODE=$1
ERROR_MSG=$2
if [ $EXIT_CODE -ne '0' ]; then
echo "$ERROR_MSG" 1>&2
echo "Exiting!" 1>&2
exit "$BAD_EXIT_CODE"
fi
}
# --------------------------------------------------
# Main
# --------------------------------------------------
ps_clamd=""
ps_clamd="$get_clam_pids_pipeline"
if [ -n "$ps_clamd" ]; then
pid_count="0"
for pid in $ps_clamd
do
pid_count=`expr $pid_count + 1`
done
die_rcode $BAD_EXIT_CODE "Error: $pid_count clamd process(es) already running!"
fi
if [ -e "$lockfile" ]; then
rm "$lockfile"
exit_code="$?"
die_rcode $exit_code "Error: 'rm $lockfile' call failed."
fi
exec /usr/local/bin/setuidgid clamav $path_to_clamd
Code: Select all
bart:/service/clamd/log# cat run
#!/bin/sh
exec /usr/local/bin/setuidgid clamav /usr/local/bin/multilog t s1000000 n20 /var/log/clamd
Code: Select all
bart:~/service/spamd# cat run
#!/bin/bash
spamd -P -x -m 10 -u spamd --bart:~/service/spamd# ps aux | grep supervise
root 4108 0.0 0.0 1240 288 ? S 09:56 0:00 supervise qmail-pop3d
root 4109 0.0 0.0 1240 288 ? S 09:56 0:00 supervise log
root 4110 0.0 0.0 1240 288 ? S 09:56 0:00 supervise qmail-send
root 4111 0.0 0.0 1240 288 ? S 09:56 0:00 supervise log
root 4112 0.0 0.0 1240 288 ? S 09:56 0:00 supervise qmail-smtpd
root 4113 0.0 0.0 1240 288 ? S 09:56 0:00 supervise log
root 4721 0.0 0.0 1240 288 ? S 11:05 0:00 supervise clamd
socketpath=/var/run/spamd.sock
Auch auffällig:
Code: Select all
Mar 22 11:13:45 bart proftpd[7055]: bart.xxx.de - ProFTPD terminating (signal 11)
Alle 30-60 Sekunden!
/var/log/clamd/current ist leer, das syslog gibt auch nicht wirklich weitere Infos raus.
Mailversand/Empfang usw. geht wie gesagt bestens.
Gruss
Michael
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-22 16:57
by mmmichael
Hi,
folgende Infos gibts übrigends ausm Logfile:
Code: Select all
+++ Started at Mon Mar 22 16:54:14 2004
Log file size limited to 5242880 bytes.
Verbose logging activated.
Running as user clamav (UID 1013, GID 1012)
Setting /tmp as global temporary directory
Reading databases from /usr/share/clamav
Protecting against 20482 viruses.
ERROR: Socket file /var/clamav/clamd.sock is in use by another process.
Davon steht jede Sekunden eins drin.
Pstree ergibt unter anderem folgendes:
Code: Select all
|-svscanboot-+-readproctitle
| `-svscan-+-2*[supervise---tcpserver]
| |-3*[supervise---multilog]
| |-supervise---qmail-send-+-qmail-clean
| | |-qmail-lspawn
| | `-qmail-rspawn
| `-supervise---clamd
Gruss
Michael[/quote]
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-22 19:30
by kenzo
Mit
solltest Du mehr Infos über das Verhalten der von den daemontools gestarteten daemons bekommen.
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-23 13:19
by mmmichael
Hi,
dabei werden leider überhaupt keine Infos ausgespuckt ...
Lasse clamd / spamd jetzt erstmal nicht über Daemontools laufen und werde mich wieder um die Probleme bemühen, wenn sich meine Nerven beruhigt haben :-).
Gruss
Michael
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-24 00:24
by mmmichael
Hi,
also für alle dies interessiert:
spamd ist anscheinend aufgrund der völlig veralteten woody/stable 2.20 Version ständig abgestürzt.
In einer aktuell 2.63 Version läuft jetzt alles bestens....
clamd läuft weiterhin völlig instabil:
Code: Select all
bart:/service/clamd/supervise# svstat /service/clamd/
/service/clamd/: up (pid 3148) 0 seconds
Nach einem erneuten Aufruf von svstat habe ich wieder die gleiche Meldung, jedoch einen anderen PID
Hab auch nochmal eine andere clamav Version installiert ... hat nichts gebracht.
Im Logfile steht sekündlich folgendes:
Code: Select all
+++ Started at Wed Mar 24 00:38:23 2004
Log file size limited to 5242880 bytes.
Verbose logging activated.
Running as user clamav (UID 1013, GID 1012)
Setting /tmp as global temporary directory
Reading databases from /usr/local/share/clamav
Protecting against 20690 viruses.
ERROR: Socket file /var/clamav/clamd.sock is in use by another process.
Wenn ich dann /var/clamav/clamd.sock lösche, wirds direkt wieder angelegt und alles geht bleibt beim alten...
Was zum Teufel kann das bloß sein?
Gruss
Michael
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-24 15:53
by mmmichael
Hi,
warum wird dieser **** jede Sekunde neu gestartet? Bin echt am verzweifeln, weil die ganze vorgehensweise eigentlich ja recht simple ist :-(.
Gruss
Michael
Code: Select all
Wed Mar 24 15:49:41 2004 -> Running as user clamav (UID 1013, GID 1012)
Wed Mar 24 15:49:41 2004 -> Setting /tmp as global temporary directory
Wed Mar 24 15:49:41 2004 -> Reading databases from /usr/local/share/clamav
Wed Mar 24 15:49:42 2004 -> +++ Started at Wed Mar 24 15:49:42 2004
Wed Mar 24 15:49:42 2004 -> Log file size limited to 2097152 bytes.
Wed Mar 24 15:49:42 2004 -> Verbose logging activated.
Wed Mar 24 15:49:42 2004 -> Running as user clamav (UID 1013, GID 1012)
Wed Mar 24 15:49:42 2004 -> Setting /tmp as global temporary directory
Wed Mar 24 15:49:42 2004 -> Reading databases from /usr/local/share/clamav
Wed Mar 24 15:49:43 2004 -> +++ Started at Wed Mar 24 15:49:43 2004
Wed Mar 24 15:49:43 2004 -> Log file size limited to 2097152 bytes.
Wed Mar 24 15:49:43 2004 -> Verbose logging activated.
Wed Mar 24 15:49:43 2004 -> Running as user clamav (UID 1013, GID 1012)
Wed Mar 24 15:49:43 2004 -> Setting /tmp as global temporary directory
Wed Mar 24 15:49:43 2004 -> Reading databases from /usr/local/share/clamav
Wed Mar 24 15:49:44 2004 -> +++ Started at Wed Mar 24 15:49:44 2004
Wed Mar 24 15:49:44 2004 -> Log file size limited to 2097152 bytes.
Wed Mar 24 15:49:44 2004 -> Verbose logging activated.
Wed Mar 24 15:49:44 2004 -> Running as user clamav (UID 1013, GID 1012)
Wed Mar 24 15:49:44 2004 -> Setting /tmp as global temporary directory
Wed Mar 24 15:49:44 2004 -> Reading databases from /usr/local/share/clamav
Wed Mar 24 15:49:45 2004 -> +++ Started at Wed Mar 24 15:49:45 2004
Wed Mar 24 15:49:45 2004 -> Log file size limited to 2097152 bytes.
Wed Mar 24 15:49:45 2004 -> Verbose logging activated.
Wed Mar 24 15:49:45 2004 -> Running as user clamav (UID 1013, GID 1012)
Wed Mar 24 15:49:45 2004 -> Setting /tmp as global temporary directory
Wed Mar 24 15:49:45 2004 -> Reading databases from /usr/local/share/clamav
Wed Mar 24 15:49:46 2004 -> +++ Started at Wed Mar 24 15:49:46 2004
Wed Mar 24 15:49:46 2004 -> Log file size limited to 2097152 bytes.
Wed Mar 24 15:49:46 2004 -> Verbose logging activated.
Wed Mar 24 15:49:46 2004 -> Running as user clamav (UID 1013, GID 1012)
Wed Mar 24 15:49:46 2004 -> Setting /tmp as global temporary directory
Wed Mar 24 15:49:46 2004 -> Reading databases from /usr/local/share/clamav
Wed Mar 24 15:49:47 2004 -> +++ Started at Wed Mar 24 15:49:47 2004
Wed Mar 24 15:49:47 2004 -> Log file size limited to 2097152 bytes.
Wed Mar 24 15:49:47 2004 -> Verbose logging activated.
Wed Mar 24 15:49:47 2004 -> Running as user clamav (UID 1013, GID 1012)
Wed Mar 24 15:49:47 2004 -> Setting /tmp as global temporary directory
Wed Mar 24 15:49:47 2004 -> Reading databases from /usr/local/share/clamav
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-24 17:03
by kenzo
Habe clamd hier[tm] mit daemontools einträchtig am Laufen - welche Version nutzt Du?
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-24 17:19
by mmmichael
kenzo wrote:Habe clamd hier[tm] mit daemontools einträchtig am Laufen - welche Version nutzt Du?
Hi,
clamd habe ich in Version 0.68 und 0.70rc getestet, daemontools in Version 0.76.
Welche hast du denn? Wie sieht dein run File aus?
Clamd starte ich aktuell wie folgt:
#!/bin/bash
exec clamd --config-file=/etc/clamav.conf
Gruss
Michael
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-24 20:02
by kenzo
Clamd starte ich aktuell wie folgt:
#!/bin/bash
exec clamd --config-file=/etc/clamav.conf
Wie jetzt? Oben hast Du doch geschrieben, Du startest es mit dem Skript von Jesse D. Guardiani. Damit läuft's hier sehr gut.
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-24 20:48
by mmmichael
Hi,
sorry, hast recht, oben habe ich was anderes geschrieben!
Ich hab jetzt mehrere Varianten verwendet, die ich im Internet gefunden hatte, unter anderem auch das Script von der Clamav Seite.
Welche Version verwendest du denn, bzw. welche Optionen hast du in der /etc/clamav.conf Datei aktiv?
Gruss
Michael
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-24 21:23
by kenzo
So wie bei Guardiani beschrieben, plus
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-24 21:54
by mmmichael
Hi,
werds direkt mal testen ... Welche clamav Version hast du denn? Auch die 0.68?
Gruss
Michael
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-24 22:03
by mmmichael
Hi,
also, es tut sich was, wobei ich die Fehlermeldungen schon hatte:
bart:/var/log# ps aux | grep readproc
root 23350 0.0 0.0 1236 252 ? S 21:54 0:00 readproctitle service errors: ...?./run: bad: command not found?Bad syntax, perhaps a bogus '-'??setuidgid: fatal: unable to run /usr/local/sbin/clamd: access denied?./run: bad: command not found?Bad syntax, perhaps a bogus '-'??setuidgid: fatal: unable to run /usr/local/sbin/clamd: access denied?./run: bad: command not found?Bad syntax, perhaps a bogus '-'??setuidgid: fatal: unable to run /usr/local/sbin/clamd: access denied?
bart:/service/clamd# ./run
Bad syntax, perhaps a bogus '-'?
setuidgid: fatal: unable to run /usr/local/sbin/clamd: access denied
Was könnte das denn sein?
Gerade der "Bad syntax" wundert mich, hab nochmal alles durchgeguckt, konnte jedoch nichts finden.
Folgendes ist aber schonmal nicht schlecht:
bart:/usr/local/clamav/supervise/clamd# svstat /service/clamd/log/
/service/clamd/log/: up (pid 24445) 555 seconds
Gruss
Michael
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-24 22:40
by mmmichael
Hi,
hab wieder was rausgefunden:
Wenn ich die /service/clamd/run Datei am Ende wie folgt ändere:
exec /usr/local/bin/setuidgid root $path_to_clamd
läuft alles. Wie kann das sein? Hab qscand mal /bin/bash zugewiesen und "su qscand" gemacht. Konnte danach auch nicht auf /usr/local/sbin/clamd zugreifen, was ja auch irgendwie logisch ist.
Ein pstree ergibt:
|-svscanboot-+-readproctitle
| `-svscan-+-supervise---spamd
| |-2*[supervise---tcpserver]
| |-4*[supervise---multilog]
| |-supervise---qmail-send-+-qmail-clean
| | |-qmail-lspawn
| | `-qmail-rspawn
| `-supervise---clamd---clamd---clamd
Warum taucht da clamd so oft auf?
Was mach ich denn jetzt noch falsch :-(?
Gruss
Michael
clamd
Posted: 2004-03-25 02:58
by ur
hi michael,
hatte das gleiche problem. nachdem ich mich auf dein posting hin nochmal intesiv damit beschaeftigt hab, konnte ich fuer mich folgende loesung finden:
habe debian woody mit pd-admin und qmail. zuerst hat sich spamd staendig respwaned - das lag daran, dass /tmp nicht auf 1777 gesetzt war.
clamd hatte in der run den falschen pfad - als der richtig war, kam auch staendig der respawn. loesung: in der clamav.conf habe ich "UseProcesses" eingefuegt. lefft. Keine zu hohe ServerLoad mehr.
Dies war das Problem mit den svscanboot/svc/daemontools. Endlich geloest ;-)
hth
gruss uli
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-03-25 10:04
by mmmichael
Hi,
hab das jetzt auch getestet, leider ohne Erfolg:
Solange ich beim run Script root als setuidgid angebe, läuft alles, wobei clamd dann nachher trotzdem und wie gewünscht als qscand läuft.
Merkwürdig ist auch irgendwie, dass
/usr/local/bin/setuidgid qscand /usr/local/sbin/clamd
eigentlich doch überhaupt nicht funktonieren kann, da der Benutzer qscand doch auf keinen Fall zugriff auf clamd im sbin Verzeichnis haben kann/darf, dafür ist das sbin/ Verzeichnis doch gerade da!?
Mensch, mensch, mensch, hat mich das Problem bis jetzt ne Lebensqualität gekostet :-( :-).
Gruss
Michael
Re: Probleme mit spamd / clamd ( / proftpd) <defunct>
Posted: 2004-12-25 21:30
by koda
Sorry wenn ich das Thema nochmal vorhole...
ur, ich hab da ebenfalls das Problem mit PD Admin. Ich nutze die 2er Version.
root 1798 2.0 0.0 0 0 ? Z 21:26 0:00 [clamd] <defunct>
Ich kann nicht nachvollziehen, wo die clamav.conf sein soll. Zumindest kann ich die bei mir nicht finden.
Und dieses "UseProcesses", wo und wie genau hast du das eingetragen?
*EDIT*
Und das sagt meine syslog *hmpf*
Dec 25 21:29:40 s03 clamd[1963]: clamd daemon 0.80 (OS: linux-gnu, ARCH: i386, CPU: i686)
Dec 25 21:29:40 s03 clamd[1963]: Log file size limited to 1048576 bytes.
Dec 25 21:29:40 s03 clamd[1963]: Reading databases from /usr/local/pd-admin2/share/clamav
Dec 25 21:29:40 s03 clamd[1963]: Database initialization error.
Dec 25 21:29:41 s03 clamd[1965]: Daemon started.