forked from pool/mariadb
- fixed init script to work on SELinux machines (bnc#635645)
OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=26
This commit is contained in:
parent
e99c0e19d4
commit
e98a7596d7
@ -7,6 +7,7 @@ Wed Sep 29 12:15:59 CEST 2010 - mhrusecky@suse.cz
|
||||
http://kb.askmonty.org/v/mariadb-5150-changelog
|
||||
- release notes:
|
||||
http://kb.askmonty.org/v/mariadb-5150-release-notes
|
||||
- fixed init script to work on SELinux machines (bnc#635645)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 12 11:54:38 CEST 2010 - mhrusecky@suse.cz
|
||||
|
@ -251,6 +251,8 @@ else
|
||||
datadir=/var/lib/mysql
|
||||
mysql_daemon_user=mysql
|
||||
mysql_daemon_group=mysql
|
||||
mkdir -m 755 -p /var/run/mysql
|
||||
chown $mysql_daemon_user:$mysql_daemon_group /var/run/mysql
|
||||
pid_file=/var/run/mysql/mysqld.pid
|
||||
socket=/var/run/mysql/mysql.sock
|
||||
print_defaults=/usr/bin/my_print_defaults
|
||||
@ -264,16 +266,6 @@ else
|
||||
log_upgrade_run="${log_base}-upgrade-run.log"
|
||||
log_query="${log_base}-query.log"
|
||||
|
||||
if [ \! -d /var/run/mysql ]; then
|
||||
mkdir -p /var/run/mysql
|
||||
chown -R "$mysql_daemon_user:$mysql_daemon_group" /var/run/mysql
|
||||
chmod 0755 /var/run/mysql
|
||||
fi
|
||||
[ "`ls -ld "/var/run/mysql" | grep "^drwx.-..-.[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ] || {
|
||||
echo "Directory /var/run/mysql has strange rights"
|
||||
rc_failed; rc_status -v; rc_exit;
|
||||
}
|
||||
|
||||
parse_arguments `$print_defaults $defaults mysqld mysql_server`
|
||||
export TMPDIR="`cat /var/run/mysql/tmpdir 2> /dev/null`"
|
||||
|
||||
@ -288,12 +280,12 @@ else
|
||||
|
||||
# prepare tmp dir
|
||||
if [ "$TMPDIR" ] && [ -d "$TMPDIR" ] && \
|
||||
[ "`ls -ld "$TMPDIR" | grep "^drwx------[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ]; then
|
||||
[ "`ls -ld "$TMPDIR" | grep "^drwx------[\\.+]?[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ]; then
|
||||
rm -rf "$TMPDIR"
|
||||
fi
|
||||
TMPDIR="`mktemp -d -p /var/tmp mysql.XXXXXX | tee /var/run/mysql/tmpdir`"
|
||||
[ -z "$TMPDIR" ] || chown "$mysql_daemon_user:$mysql_daemon_group" "$TMPDIR"
|
||||
[ "`ls -ld "$TMPDIR" | grep "^drwx------[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ] || {
|
||||
[ "`ls -ld "$TMPDIR" | grep "^drwx------[\\.+]?[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ] || {
|
||||
echo "Can't create secure $TMPDIR"
|
||||
rc_failed; rc_status -v; rc_exit;
|
||||
}
|
||||
@ -349,10 +341,7 @@ else
|
||||
echo "`LANG="" date` - upgrading MySQL..." >> "$log_upgrade"
|
||||
echo >> "$log_upgrade"
|
||||
echo "Will update MySQL now, if you encounter any problems, please read following file:" | tee -a "$log_upgrade"
|
||||
echo " /usr/share/doc/packages/mysql/README.SuSE" | tee -a "$log_upgrade" [ "`ls -ld "$protected" | grep "^drwx------[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ] || {
|
||||
echo "Can't create secure $protected" | tee -a "$log_upgrade"
|
||||
rc_failed; rc_status -v; rc_exit;
|
||||
}
|
||||
echo " /usr/share/doc/packages/mysql/README.SuSE" | tee -a "$log_upgrade"
|
||||
# Check logs for inconsistencies
|
||||
SRCLOGS=""
|
||||
ALL_SRCLOGS=""
|
||||
@ -390,7 +379,7 @@ else
|
||||
fi
|
||||
protected="`mktemp -d -p /var/tmp mysql-protected.XXXXXX | tee /var/run/mysql/protecteddir`"
|
||||
[ -z "$protected" ] || chown "$mysql_daemon_user:$mysql_daemon_group" "$protected"
|
||||
[ "`ls -ld "$protected" | grep "^drwx------[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ] || {
|
||||
[ "`ls -ld "$protected" | grep "^drwx------[\\.+]?[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ] || {
|
||||
echo "Can't create secure $protected" | tee -a "$log_upgrade"
|
||||
rc_failed; rc_status -v; rc_exit;
|
||||
}
|
||||
@ -455,7 +444,7 @@ else
|
||||
echo -n "Shutting down service MySQL "
|
||||
kill_mysql
|
||||
if [ "$TMPDIR" ] && [ -d "$TMPDIR" ] && \
|
||||
[ "`ls -ld "$TMPDIR" | grep "^drwx------[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ]; then
|
||||
[ "`ls -ld "$TMPDIR" | grep "^drwx------[\\.+]?[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ]; then
|
||||
rm -rf "$TMPDIR"
|
||||
fi
|
||||
# Remember status and be verbose
|
||||
|
Loading…
Reference in New Issue
Block a user