Topic: hi all. new to PunBB. question about MySQL socket

so this is probably more of a sysadmin-type question than a PunBB question, so don't feel bad telling me to  go pound sand if this is inappropriate for here.

environment: OpenBSD 4.0/apache (default chrooted)/php4/mysql 5.0.22/latest punbb. everything works absolutely beautifully---thanks writing some great software!

i'm thinking about moving my /var/www directory to it's own slice of the disk. mysql is only listening on the loopback, and i use a socket for mysql, and hard link /var/run/mysql/mysql.sock to /var/www/var/run/mysql/mysql.sock so it'll be in the chroot.

so as it is now, /var/run and /var/www are on the same slice, and hard links are OK, but if i decide to move to a separate /var/www, hard links are no longer allowed across filesystems like that.

considering i don't use mysql for anything by punbb now (that *might* change in the future), is it sane for me to change the location of the socket in /etc/my.cnf to /var/www/run/mysql/mysql.sock ? that way i don't have to worry about links.

is there an easier solution i'm simply over looking?

thanks,

--john

Re: hi all. new to PunBB. question about MySQL socket

Dono if this will work for you... but... I do it on my box, to have 1 single raid array for multiple directories, and 1 "base system" root partition with just a etc, bin, and sbin  (incase the raid fails; or the "base" fails, since the base is actually mirrored to a different disk).

fstabs

# Assuming you have /dev/hda2 as root, and /dev/hda3 as the "www jail" partition, alter this to suite your system :)
/dev/hda1       /boot                           reiserfs        defaults,noauto                                 0 2
/dev/hda2       /                               reiserfs        defaults                                0 1
/dev/hda3       /mnt/chroot/www_jail            reiserfs        defaults                                0 2
/dev/hda4       none                            swap            sw,pri=1                                        0 0

# Ok, now the fun stuff
/mnt/chroot/www_jail/var/www         /var/www            none            bind                                            0 0
/var/run/mysql                 /var/www/run/mysql            none            bind                                            0 0

Basically the bind option will mount a directory to another directory. It's not exactly a directory hardlink, but in (most ^.~) practises it is. Personally I like the /dev/hd3 -> /mnt/chroot/www_jail mount, because you could create a series of directories, or files on that partition, and then bind them all around. I use this technic on my raid array, so that 99% of the system is running off the raid array, but that 1% is running off a tiny (like 1G is overkill) partition. When the raid array fails, in a bad way, that "backup" root partition can take over until I can fix the problem. Also, being 1G, I have it minored incase the root partition fails and not the raid array smile (sides, I'm using kernel sw raid, and it doesn't like being told to be a root partition).

Anywho, the mount -bind option is what you want, and that fstabs example shows the fstab syntax smile

echo "deadram"; echo; fortune;

Re: hi all. new to PunBB. question about MySQL socket

deadram wrote:

Anywho, the mount -bind option is what you want, and that fstabs example shows the fstab syntax smile

ah, yes, the bind mount. didn't even think of that. sometimes can't see the forest for the trees, or whatever that stupid saying is.

fortunately, i have some time to test things before i decide what to do, so i will investigate that, thanks!