- Move socket from the database dir to /var/run/mysql.

- Tighten perms on the database dir.
--
Suggestion of using /var/run/mysql from: Wilbern Cobb
This commit is contained in:
brad 2002-02-19 03:58:57 +00:00
parent 5080a42cbe
commit 493bc5d2d0
4 changed files with 16 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.70 2002/02/18 03:25:33 brad Exp $
# $OpenBSD: Makefile,v 1.71 2002/02/19 03:58:57 brad Exp $
# $FreeBSD: Makefile,v 1.44 1999/03/04 21:27:58 dirk Exp $
# Uses pthreads
@ -35,7 +35,8 @@ PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
DB_DIR?= /var/mysql
SUBST_VARS= DB_DIR VERSION
SOCKET_DIR= /var/run/mysql
SUBST_VARS= DB_DIR SOCKET_DIR VERSION
# Suggested flags to the C++ compiler, needed for
# high load servers otherwise MySQL will crash.
@ -51,7 +52,7 @@ CONFIGURE_ARGS+= --enable-static \
--with-comment='OpenBSD port: ${FULLPKGNAME-server}' \
--with-libwrap="/usr" \
--with-mysqld-user="mysql" \
--with-unix-socket-path="${DB_DIR}/mysql.sock" \
--with-unix-socket-path="${SOCKET_DIR}/mysql.sock" \
--without-perl \
--without-debug \
--without-readline \

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-scripts_mysql_install_db.sh,v 1.6 2001/06/02 20:18:44 brad Exp $
--- scripts/mysql_install_db.sh.orig Wed May 9 16:34:39 2001
+++ scripts/mysql_install_db.sh Sat Jun 2 01:19:10 2001
$OpenBSD: patch-scripts_mysql_install_db.sh,v 1.7 2002/02/19 03:58:57 brad Exp $
--- scripts/mysql_install_db.sh.orig Thu Feb 14 12:30:26 2002
+++ scripts/mysql_install_db.sh Mon Feb 18 20:04:30 2002
@@ -7,12 +7,9 @@
#
# All unrecognized arguments to this script are passed to mysqld.
@ -102,7 +102,7 @@ $OpenBSD: patch-scripts_mysql_install_db.sh,v 1.6 2001/06/02 20:18:44 brad Exp $
- chown $user $ldata $ldata/mysql $ldata/test;
- fi
-fi
+if test ! -d $ldata; then mkdir $ldata; chmod 711 $ldata ; fi
+if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi
+if test ! -d $ldata/mysql; then mkdir $ldata/mysql; chmod 700 $ldata/mysql ; fi
+if test ! -d $ldata/test; then mkdir $ldata/test; chmod 700 $ldata/test ; fi
+chown $user:$group $ldata $ldata/mysql $ldata/test;

View File

@ -1,10 +1,11 @@
# $OpenBSD: DEINSTALL-server,v 1.2 2001/06/02 21:57:05 brad Exp $
# $OpenBSD: DEINSTALL-server,v 1.3 2002/02/19 03:58:57 brad Exp $
#
# MySQL de-installation
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
DB_DIR=${DB_DIR}
SOCKET_DIR=${SOCKET_DIR}
echo
echo "+---------------"
@ -14,6 +15,7 @@ echo "|"
echo "| userdel mysql"
echo "| groupdel mysql"
echo "| rm -rf $DB_DIR"
echo "| rm -rf $SOCKET_DIR"
echo "|"
echo "| Do not do this if you plan on re-installing $1"
echo "| at some future time."

View File

@ -1,11 +1,12 @@
#!/bin/sh
# $OpenBSD: INSTALL-server,v 1.2 2002/01/06 07:06:25 brad Exp $
# $OpenBSD: INSTALL-server,v 1.3 2002/02/19 03:58:57 brad Exp $
#
# Pre/post-installation setup of MySQL
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
DB_DIR=${DB_DIR}
SOCKET_DIR=${SOCKET_DIR}
do_notice_pre_install()
{
@ -61,6 +62,9 @@ case $2 in
if [ ! -d $DB_DIR ]; then
do_post_install
fi
if [ ! -d $SOCKET_DIR ]; then
install -d -o mysql -g mysql -m 711 $SOCKET_DIR
fi
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2