Gentoo Forums
Gentoo Forums
Quick Search: in
SOLVED - mysql-5.0.26-r1 mysqld.sock breaks courier-authlib
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 126
Location: Sweden - Stockholm

PostPosted: Tue Oct 24, 2006 12:01 pm    Post subject: SOLVED - mysql-5.0.26-r1 mysqld.sock breaks courier-authlib Reply with quote

When upgrading from mysql-5.0.24-r1 to mysql-5.0.26-r1 i get the following error

ERROR:
Oct 24 10:06:51 firestorm authdaemond: failed to connect to mysql server (server=localhost, userid=admin): Can't connect to local MySQL server through socket ''/var/run/mysqld/mysqld.sock'' (2)
Oct 24 10:06:51 firestorm imapd-ssl: LOGIN FAILED, user=kalle, ip=[127.0.0.1]
Oct 24 10:06:51 firestorm imapd-ssl: authentication error: Input/output error


I am using courier-imap and courier-authlib and i wont to access the socket ie (localhost) i dont want to use 127.0.0.1 because i dont want network support for the mysql daemon. The socket exist and works with php but not with postfix(smtp auth) or courier.

It works fine with mysql-5.0.24-r1, so the error can be
1. mysql new version has som problems with the mysql socket (localhost)
2. courier don't have support for the new things that have happend with /var/run/mysqld/mysqld.sock

Is there anyone that have a working conf with courier against /var/run/mysqld/mysqld.sock with mysql-5.0.26-r1

any ideas?
The 2 solutions that works is
1. downgrade to mysql-5.0.24-r1
2. use network on mysql and connect to 127.0.0.1

But i want this to work with localhost and witout network.
_________________
For everyone:
Read Linux news here

For Swedish people only
Få bra spar och tjäna pengar online tips här: pengargratis forum , vad har du att förlora?

/Jenkler


Last edited by jenkler on Thu Oct 26, 2006 12:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
Nossie
Apprentice
Apprentice


Joined: 19 Apr 2002
Posts: 178

PostPosted: Tue Oct 24, 2006 6:02 pm    Post subject: Reply with quote

I'm having the same problem.

Both courier and exim use the database, but strangely my courier installation still works using the socket. Exim stopped working.
Using 127.0.0.1 instead of localhost 'solved' the problem.

Nossie
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 126
Location: Sweden - Stockholm

PostPosted: Wed Oct 25, 2006 6:37 am    Post subject: There must be a solution i hope Reply with quote

Try to restart courier-authlib, then it stops working.
Yeah i know that 127.0.0.1 works but i want to use the socket and nonetwork in my.cnf config
Postfix smtp auth with sasl also don't work (/etc/sasl2/smtpd.conf)

Is there any courier or postfix hacker that could check on this issue?
_________________
For everyone:
Read Linux news here

For Swedish people only
Få bra spar och tjäna pengar online tips här: pengargratis forum , vad har du att förlora?

/Jenkler
Back to top
View user's profile Send private message
mneisen
n00b
n00b


Joined: 23 Feb 2005
Posts: 29

PostPosted: Wed Oct 25, 2006 10:38 am    Post subject: Reply with quote

Hi,

I use Postfix with SASL and have the same problems as you guys.

Quote:
Yeah i know that 127.0.0.1 works but i want to use the socket and nonetwork in my.cnf config
Postfix smtp auth with sasl also don't work (/etc/sasl2/smtpd.conf)


What do you mean by 127.0.01 works great? SImply replace all "localhost" (for using the socket) with "127.0.0.1"? This failed in my case, I have to give the non-local IP address.

Anyway, does anybody know how to work around this one with Postdix+SASL?
Back to top
View user's profile Send private message
mneisen
n00b
n00b


Joined: 23 Feb 2005
Posts: 29

PostPosted: Wed Oct 25, 2006 12:52 pm    Post subject: Re: mysql-5.0.26-r1 mysqld.sock breaks courier-authlib Reply with quote

jenkler wrote:

The 2 solutions that works is
1. downgrade to mysql-5.0.24-r1
2. use network on mysql and connect to 127.0.0.1


In my case, courier-sasl won't work - neither with localhost nor 127.0.0.1 nor the non-local IP. So the second solution (although I might like to call it quickfix) does not help in my situation.

How do you do a downgrade (f.e. to MySQL 5.0.26 which is the last working version for me) if the corresponding ebuild has gone? There is only the 5.0.26-r1 ebuild in portage now, so I can downgrade to MySQL 4 (which will break some of my other applications) or live with the fact that SMTP authentication will not work - and nobody can send eMails using my MTA.

Any suggestions, especially how to downgrade without an ebuild in portage?

Thanks in advance!
Back to top
View user's profile Send private message
dehpeh
n00b
n00b


Joined: 19 Dec 2002
Posts: 12
Location: Germany

PostPosted: Wed Oct 25, 2006 12:54 pm    Post subject: Reply with quote

I have the same problem after upgrade from dev-db/mysql-4.1.20 to dev-db/mysql-4.1.21

Code:
postfix-log: trivial-rewrite[8252]: warning: connect to mysql server localhost:
Can't connect to local MySQL server through socket ''/var/run/mysqld/mysqld.sock'' (2)

pam_mysql via syslog: saslauthd[3912]: pam_mysql - MySQL error (Can't connect to local
MySQL server through socket ''/var/run/mysqld/mysqld.sock'' (2))



The file /var/run/mysqld/mysqld.sock exists, postfix did NOT run in chroot.
I can access this via mysqladmin.
Code:
# ls -ld /var/run/mysqld/ /var/run /var
drwxr-xr-x 13 root  root  4096 24. Mai 22:29 /var
drwxr-xr-x  5 root  root  4096 25. Okt 14:16 /var/run
drwxrwxrwx  2 mysql mysql 4096 25. Okt 11:19 /var/run/mysqld/
# ls -l /var/run/mysqld/mysqld.sock
srwxrwxrwx 1 mysql mysql 0 25. Okt 11:19 /var/run/mysqld/mysqld.sock



Code:
# mysqladmin --socket=/var/run/mysqld/mysqld.sock -u root -p version
Enter password:
Server version          4.1.21-log
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/run/mysqld/mysqld.sock
Uptime:                 3 hours 23 min 3 sec
Threads: 14  Questions: 11505  Slow queries: 0  Opens: 17  Flush tables: 1  Open tables: 11  Queries per second avg: 0.944



Code:
# netstat -nlp
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     5276947 9144/mysqld         /var/run/mysqld/mysqld.sock



my /etc/postfix/mysql_transport_maps.cf
Code:
hosts = localhost

when i change this to:
Code:
hosts = unix:/var/run/mysqld/mysqld.sock

it works fine, but it is irreproducible.

Same stupid solution for /etc/pam.d/smtp:
Change host=localhost to host=127.0.0.1

For testing, i recompiled postfix, pam_mysql and dev-libs/cyrus-sasl, but no change/result.

:(
Back to top
View user's profile Send private message
mneisen
n00b
n00b


Joined: 23 Feb 2005
Posts: 29

PostPosted: Wed Oct 25, 2006 1:24 pm    Post subject: Reply with quote

dehpeh,

your solution does not work for me ... :?

Any suggestions how to get cyrus-sasl + MySQL 5.0.26-r1 up and running?
Back to top
View user's profile Send private message
dehpeh
n00b
n00b


Joined: 19 Dec 2002
Posts: 12
Location: Germany

PostPosted: Wed Oct 25, 2006 1:33 pm    Post subject: Reply with quote

mneisen wrote:

What do you mean by 127.0.0.1 works great? SImply replace all "localhost" (for using the socket) with "127.0.0.1"? This failed in my case, I have to give the non-local IP address.


is your mysql on another server?

check your /etc/mysql/my.cnf
bind-address=127.0.0.1 change to bind-address=0.0.0.0 when you will connect over network! (remove skip-networking)


Last edited by dehpeh on Wed Oct 25, 2006 2:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
mneisen
n00b
n00b


Joined: 23 Feb 2005
Posts: 29

PostPosted: Wed Oct 25, 2006 1:35 pm    Post subject: Reply with quote

Additional information:

Sockets *do* work for me under MySQL 5.0.26-r1:

Code:
node-0 ~ # mysqladmin --socket=/var/run/mysqld/mysqld.sock -u root version
mysqladmin  Ver 8.41 Distrib 5.0.26, for pc-linux-gnu on x86_64
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version          5.0.26-log
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/run/mysqld/mysqld.sock
Uptime:                 3 hours 2 min 21 sec

Threads: 10  Questions: 6840  Slow queries: 5  Opens: 256  Flush tables: 1  Open tables: 250  Queries per second avg: 0.625


Cyrus-SASL has still problems connecting to the database with either one of:
Code:
pwcheck_method: auxprop
auxprop_plugin: sql
sql_engine: mysql
sql_hostname: unix:/var/run/mysqld/mysqld.sock

and
Code:
pwcheck_method: auxprop
auxprop_plugin: sql
sql_engine: mysql
sql_hostname: 127.0.0.1

and
Code:
pwcheck_method: auxprop
auxprop_plugin: sql
sql_engine: mysql
sql_hostname: localhost

and
Code:
pwcheck_method: auxprop
auxprop_plugin: sql
sql_engine: mysql
sql_hostname: 88.198.37.77


Any suggestions?
Back to top
View user's profile Send private message
mneisen
n00b
n00b


Joined: 23 Feb 2005
Posts: 29

PostPosted: Wed Oct 25, 2006 1:48 pm    Post subject: Reply with quote

dehpeh wrote:

is your mysql on another server?

check your /etc/mysql/my.cnf
bind=127.0.0.1 change to bind=0.0.0.0 when you will connect over network!


MySQL runs on the very same node. I changed the config file my.cnf as you said but guess what - it does not work ... :cry:
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 126
Location: Sweden - Stockholm

PostPosted: Wed Oct 25, 2006 2:08 pm    Post subject: Reply with quote

Quote:

How do you do a downgrade (f.e. to MySQL 5.0.26 which is the last working version for me) if the corresponding ebuild has gone? There is only the 5.0.26-r1 ebuild in portage now, so I can downgrade to MySQL 4 (which will break some of my other applications) or live with the fact that SMTP authentication will not work - and nobody can send eMails using my MTA.


To make a downgrade to a working mysql just do:

cp mysql-5.0.26-r1.ebuild to mysql-5.0.24-r1.ebuild
run:
ebuild mysql-5.0.24-r1.ebuild digest

Now you have a vaild ebuild file.

mysql-5.0.24-r1.ebuild works fine for me

I have this in my my.cnf so i need the socket to work.
skip-networking
bind-address = localhost

Quote:

Sockets *do* work for me under MySQL 5.0.26-r1:


Yes, in mysql-5.0.26-r1 the mysql socket works BUT not for all applications

Yes, PHP, mysql -u root -p and many other things works but for me
courier and postfix dont work only if i run mysql with network and connects to 127.0.0.1

Quote:

What do you mean by 127.0.01 works great? SImply replace all "localhost" (for using the socket) with "127.0.0.1"? This failed in my case, I have to give the non-local IP address.


Thats the thing, i dont want to use network in mysql, if you have this in your configuration file you can't use 127.0.0.1 (skip-networking)

skip-networking
bind-address = localhost

127.0.0.1 and localhost is not the same thing in this case
localhost = socket (mysqld.sock) in /var
127.0.0.1 = if mysql is listening on 127.0.0.1

if you have
bind-address = 0.0.0.0

mysql is listening on all interfaces

postfix and courier should work with
skip-networking
bind-address = localhost

Would be nice if there was a postfix or courier hacker here that could explain if this :D
_________________
For everyone:
Read Linux news here

For Swedish people only
Få bra spar och tjäna pengar online tips här: pengargratis forum , vad har du att förlora?

/Jenkler


Last edited by jenkler on Wed Oct 25, 2006 2:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
mneisen
n00b
n00b


Joined: 23 Feb 2005
Posts: 29

PostPosted: Wed Oct 25, 2006 2:14 pm    Post subject: Reply with quote

Thanks a million, I will try that at once and report back.
Back to top
View user's profile Send private message
mneisen
n00b
n00b


Joined: 23 Feb 2005
Posts: 29

PostPosted: Wed Oct 25, 2006 2:25 pm    Post subject: Reply with quote

The first problem I came across while following jenkler's suggestions is that mysql-5.0.24.tar.gz is no longer on the mirrors. Any idea where I might find that? MySQL only offers packages that are named differently (f.e. mysql-standard-5.0.26-linux-i686.tar.gz) and I do not know whether this is the correct file.

Suggestions?
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 126
Location: Sweden - Stockholm

PostPosted: Wed Oct 25, 2006 2:30 pm    Post subject: Reply with quote

mneisen wrote:
The first problem I came across while following jenkler's suggestions is that mysql-5.0.24.tar.gz is no longer on the mirrors. Any idea where I might find that? MySQL only offers packages that are named differently (f.e. mysql-standard-5.0.26-linux-i686.tar.gz) and I do not know whether this is the correct file.

Suggestions?


Try changing mirrors this in your make.conf

GENTOO_MIRRORS="http://mirror.pudas.net/gentoo/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"

You should be able to use mysql-standard-5.0.24-linux-i686.tar.gz look what emerge is trying to download and add this file with the same name in distfiles

dont forget to run another digest on the new ebuild file

EDIT:D mysql-standard-5.0.24-linux-i686.tar.gz, but try the mirrors first
_________________
For everyone:
Read Linux news here

For Swedish people only
Få bra spar och tjäna pengar online tips här: pengargratis forum , vad har du att förlora?

/Jenkler


Last edited by jenkler on Wed Oct 25, 2006 2:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
mneisen
n00b
n00b


Joined: 23 Feb 2005
Posts: 29

PostPosted: Wed Oct 25, 2006 2:36 pm    Post subject: Reply with quote

Did you mean linux-5.0.26-...tar.gz? Or is this a type and you mean the 5.0.24...tar.gz?
Back to top
View user's profile Send private message
mneisen
n00b
n00b


Joined: 23 Feb 2005
Posts: 29

PostPosted: Thu Oct 26, 2006 9:10 am    Post subject: [solved]: Postfix+Cyrus-SASL+MySQL Reply with quote

Hi again,

after much trouble I finally got my Postfix+Cyrus-SASL+MySQL problem fixed - downgrading to MySQL 5.0.24-r1 solved the issue. As the downgrade is not a trivial operation (f.e., 5.0.24-r1 is no longer in Portage since October 21) I did a write-up of my way of dealing with the problem. It is written in German (sorry for this, but my blog is in German) and can be found here:

In the blog post, I also provide links for mysql-5.0.24.tar.gz and mysql-patchset-5.0.24-r2.tar.gz because both files are no longer available via the Gentoo mirror network.

I might do a english translation today or tomorrow covering the main steps. As for now, non-German-speaking people should get the gist by following the commands listed in the article.

Hope that helps more than one folk out there! :-D

Regards
mneisen
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 126
Location: Sweden - Stockholm

PostPosted: Thu Oct 26, 2006 12:39 pm    Post subject: Bug fixed Reply with quote

The bug is now fixed.

http://bugs.gentoo.org/show_bug.cgi?id=152455

Recompile dev-db/mysql-5.0.26-r1 for a working mysql :D
_________________
For everyone:
Read Linux news here

For Swedish people only
Få bra spar och tjäna pengar online tips här: pengargratis forum , vad har du att förlora?

/Jenkler
Back to top
View user's profile Send private message
dehpeh
n00b
n00b


Joined: 19 Dec 2002
Posts: 12
Location: Germany

PostPosted: Thu Oct 26, 2006 12:50 pm    Post subject: Reply with quote

Hi jenkler, is this fixed in dev-db/mysql-4.1.21, too?
Back to top
View user's profile Send private message
mneisen
n00b
n00b


Joined: 23 Feb 2005
Posts: 29

PostPosted: Thu Oct 26, 2006 1:12 pm    Post subject: Reply with quote

Thank you jenkler.

Well, in that case I guess I might skip the translation of my blog post ... :-D
Back to top
View user's profile Send private message
CHTEKK
Retired Dev
Retired Dev


Joined: 15 Apr 2004
Posts: 458

PostPosted: Thu Oct 26, 2006 7:35 pm    Post subject: Reply with quote

dehpeh wrote:
Hi jenkler, is this fixed in dev-db/mysql-4.1.21, too?


Yup, the bug wasn't version specific at all, it affected all dev-db/mysql ebuilds, between last saturday evening and monday morning (when we fixed it), so if you (re)installed MySQL in that timeframe, just emerge --sync again and re-emerge mysql to fix this, sorry for the inconvenience.
_________________
Best regards, chtekk.

"We are crazy, but who cares, to our heaven there are stairs!" - Xandria
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum