Mysql.sock moved, and RT can't find it

I have moved the mysql socket from it’s default location (/tmp) to
/var/run/mysql, for reasons of security. rt seems to ignore my.cnf,
and continues to look for it in /tmp. I have (temporarily) made it
work again, by using a symbolic link, but I’d really like to figure
out how to tell rt where to find the real socket.

Any help out there?

rt-3.2.2
mysql-4.0.23a
apache-2.0.52
FreeBSD 4.10

Thanks.
Steve
Steve Sizemore <steve (at) ls.berkeley.edu>, (510) 642-8570
Unix System Manager
Dept. of Mathematics and College of Letters and Science
University of California, Berkeley

RT uses my.cnf like all other mysql client libs. May be you put socket
configuration to wrong block in my.cnf.

Steve Sizemore wrote:

Steve Sizemore wrote:

I have moved the mysql socket from it’s default location (/tmp) to
/var/run/mysql, for reasons of security. rt seems to ignore my.cnf,
and continues to look for it in /tmp. I have (temporarily) made it
work again, by using a symbolic link, but I’d really like to figure
out how to tell rt where to find the real socket.

Any help out there?

rt-3.2.2
mysql-4.0.23a
apache-2.0.52
FreeBSD 4.10

RT uses my.cnf like all other mysql client libs. May be you put socket
configuration to wrong block in my.cnf.

I put it in the client block -

[client]
port = 3306
socket = /var/run/mysql/mysql.sock

which works for other clients, like mod_php. Where else would it go?On Thu, Jan 13, 2005 at 09:14:05AM -0700, Joe Benson wrote:

Make sure you don’t have two my.cnf files. I don’t know about FreeBSD,
I run Linux, but Redhat default rpms would put a my.cnf file in /etc.

Yes, I did have two - /etc/my.cnf and /usr/local/etc/my.cnf, but there
was hardly anything in /usr/local/etc/my.cnf; neither removing it, nor
linking it to /etc/my.cnf makes any difference. (mysql on FreeBSD looks
at /etc/my.cnf.)

So, I’m still looking for ideas…

Thanks.
Steve
Steve Sizemore <steve (at) ls.berkeley.edu>, (510) 642-8570
Unix System Manager
Dept. of Mathematics and College of Letters and Science
University of California, Berkeley

Steve Sizemore wrote:>On Thu, Jan 13, 2005 at 04:36:45PM +0300, Ruslan U. Zakirov wrote:

Steve Sizemore wrote:

I have moved the mysql socket from it’s default location (/tmp) to
/var/run/mysql, for reasons of security. rt seems to ignore my.cnf,
and continues to look for it in /tmp. I have (temporarily) made it
work again, by using a symbolic link, but I’d really like to figure
out how to tell rt where to find the real socket.

Any help out there?

rt-3.2.2
mysql-4.0.23a
apache-2.0.52
FreeBSD 4.10

RT uses my.cnf like all other mysql client libs. May be you put socket
configuration to wrong block in my.cnf.

I put it in the client block -

[client]
port = 3306
socket = /var/run/mysql/mysql.sock

which works for other clients, like mod_php. Where else would it go?

On Thu, Jan 13, 2005 at 09:14:05AM -0700, Joe Benson wrote:

Make sure you don’t have two my.cnf files. I don’t know about FreeBSD,
I run Linux, but Redhat default rpms would put a my.cnf file in /etc.

Yes, I did have two - /etc/my.cnf and /usr/local/etc/my.cnf, but there
was hardly anything in /usr/local/etc/my.cnf; neither removing it, nor
linking it to /etc/my.cnf makes any difference. (mysql on FreeBSD looks
at /etc/my.cnf.)

So, I’m still looking for ideas…

Thanks.
Steve

Look for mysql.pm in your perl DBD install. There’s a variable
"mysql_socket" that appears to be the default … reset it to the new
path and give RT another shot (remembering to restart apache afterwards).

Alternatively, grep around for the old path in the RT source and the
DBD. That’s how I found it on my box:

[root@support etc]# grep mysql_sock
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi//
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/DBD/mysql.pm:
mysql_socket=/dev/mysql
[root@support etc]#

–m

Steve Sizemore wrote:

Steve Sizemore wrote:

I have moved the mysql socket from it’s default location (/tmp) to
/var/run/mysql, for reasons of security. rt seems to ignore my.cnf,
and continues to look for it in /tmp. I have (temporarily) made it
work again, by using a symbolic link, but I’d really like to figure
out how to tell rt where to find the real socket.

Any help out there?

rt-3.2.2
mysql-4.0.23a
apache-2.0.52
FreeBSD 4.10

Look for mysql.pm in your perl DBD install. There’s a variable
"mysql_socket" that appears to be the default … reset it to the new
path and give RT another shot (remembering to restart apache afterwards).

Yes, I did that before I posted my original message. (I also just redid
it, to be sure that I didn’t miss something the first time.) There is
no variable in the perl code with that name. There is something in a C
program (dbdimp.c), but it’s not clear where it’s getting the value,
or how I’d go about resetting it.

Alternatively, grep around for the old path in the RT source and the
DBD. That’s how I found it on my box:

Nope, nothing there.

I did narrow it down, though (I think) to
/usr/local/rt3/lib/RT/Handle.pm, which is the RT module that sets up
the connection to mysql. There’s nothing in there that specifies the
socket name, though, so I guess that hasn’t been added to RT.

[root@support etc]# grep mysql_sock
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi//
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/DBD/mysql.pm:
mysql_socket=/dev/mysql

That’s just from the man page - not real perl code. :frowning:

Still, all this shouldn’t really be necessary. If RT (or Perl DBD)
would respect /etc/my.cnf, life would be easy.

Steve
Steve Sizemore <steve (at) ls.berkeley.edu>, (510) 642-8570
Unix System Manager
Dept. of Mathematics and College of Letters and Science
University of California, Berkeley

Still, all this shouldn’t really be necessary. If RT (or Perl DBD)
would respect /etc/my.cnf, life would be easy.

You’ve probably solved this already but… Last time I was poking at
this behavior, I found various docs asserting it was a default
inherent in DBD::mysql. My testing confirmed this. DBD::mysql does pay
attention to an environmental variable, so you can have your rt site
config from %ENV, but that’s kinda ugly.

seph