trim down INSTALL -> @newuser/@newgroup
This commit is contained in:
parent
2a36ea7b8c
commit
e177182693
@ -1,14 +1,11 @@
|
||||
#!/bin/sh
|
||||
# $OpenBSD: INSTALL-server,v 1.9 2004/06/23 04:04:05 brad Exp $
|
||||
# $OpenBSD: INSTALL-server,v 1.10 2004/10/12 21:14:42 espie Exp $
|
||||
#
|
||||
# Pre/post-installation setup of MySQL
|
||||
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
PREFIX=${PKG_PREFIX:-/usr/local}
|
||||
DB_DIR=${DB_DIR}
|
||||
MYSQLUSER=_mysql
|
||||
MYSQLGROUP=_mysql
|
||||
ID=502
|
||||
|
||||
do_notice_existingdir()
|
||||
{
|
||||
@ -27,46 +24,19 @@ do_notice_existingdir()
|
||||
echo
|
||||
}
|
||||
|
||||
do_usergroup_install()
|
||||
{
|
||||
# Create MySQL user and group
|
||||
groupinfo -e $MYSQLGROUP
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "===> Using $MYSQLGROUP group for MySQL"
|
||||
else
|
||||
echo "===> Creating $MYSQLGROUP group for MySQL"
|
||||
groupadd -g $ID $MYSQLGROUP
|
||||
fi
|
||||
userinfo -e $MYSQLUSER
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "===> Using $MYSQLUSER user for MySQL"
|
||||
else
|
||||
echo "===> Creating $MYSQLUSER user for MySQL"
|
||||
useradd -g $MYSQLGROUP -d /nonexistent -L daemon -c 'MySQL Account' -s /sbin/nologin -u $ID $MYSQLUSER
|
||||
fi
|
||||
}
|
||||
|
||||
do_database_install()
|
||||
{
|
||||
$PREFIX/bin/mysql_install_db
|
||||
}
|
||||
|
||||
case $2 in
|
||||
PRE-INSTALL)
|
||||
if [ -d $DB_DIR ]; then
|
||||
do_notice_existingdir $1
|
||||
fi
|
||||
do_usergroup_install
|
||||
;;
|
||||
POST-INSTALL)
|
||||
if [ ! -d $DB_DIR ]; then
|
||||
if [ -d $DB_DIR ]; then
|
||||
do_notice_existingdir
|
||||
else
|
||||
do_database_install
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
@ -1,4 +1,6 @@
|
||||
@comment $OpenBSD: PLIST-server,v 1.13 2004/08/10 00:52:43 espie Exp $
|
||||
@comment $OpenBSD: PLIST-server,v 1.14 2004/10/12 21:14:42 espie Exp $
|
||||
@newgroup _mysql:502
|
||||
@newuser _mysql:502:_mysql:daemon:MySQL Account:/nonexistent:/sbin/nologin
|
||||
bin/comp_err
|
||||
bin/isamchk
|
||||
bin/isamlog
|
||||
@ -217,7 +219,5 @@ share/mysql/swedish/errmsg.txt
|
||||
share/mysql/ukrainian/
|
||||
share/mysql/ukrainian/errmsg.sys
|
||||
share/mysql/ukrainian/errmsg.txt
|
||||
@extraunexec userdel _mysql
|
||||
@extraunexec groupdel _mysql
|
||||
@extraunexec rm -rf ${DB_DIR}
|
||||
@extraunexec rm -rf ${SOCKET_DIR}
|
||||
|
Loading…
Reference in New Issue
Block a user