Improve error message when log file is not writable
This commit is contained in:
parent
8102b4c264
commit
f2af251c7d
@ -29,6 +29,20 @@ fi
|
||||
|
||||
# Set up the errlogfile with appropriate permissions
|
||||
touch "$errlogfile"
|
||||
ret=$?
|
||||
# Provide some advice if the log file cannot be touched
|
||||
if [ $ret -ne 0 ] ; then
|
||||
errlogdir=$(dirname $errlogfile)
|
||||
if ! [ -d "$errlogdir" ] ; then
|
||||
echo "The directory $errlogdir does not exist."
|
||||
elif [ -f "$errlogfile" ] ; then
|
||||
echo "The log file $errlogfile cannot be touched, please, fix its permissions."
|
||||
else
|
||||
echo "The log file $errlogfile could not be created."
|
||||
fi
|
||||
echo "The daemon will be run under $myuser:$mygroup"
|
||||
exit 1
|
||||
fi
|
||||
chown "$myuser:$mygroup" "$errlogfile"
|
||||
chmod 0640 "$errlogfile"
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
|
||||
|
@ -43,7 +43,9 @@ datadir="$result"
|
||||
|
||||
# if there is log_error in the my.cnf, my_print_defaults still
|
||||
# returns log-error
|
||||
get_mysql_option mysqld_safe log-error "`hostname`.err"
|
||||
# log-error might be defined in mysqld_safe and mysqld sections,
|
||||
# the former has bigger priority
|
||||
get_mysql_option "mysqld_safe mysqld" log-error "`hostname`.err"
|
||||
errlogfile="$result"
|
||||
|
||||
get_mysql_option mysqld socket "/var/lib/mysql/mysql.sock"
|
||||
|
@ -840,6 +840,7 @@ fi
|
||||
- Multilib support re-worked
|
||||
- Introduce new option with_mysqld_unit
|
||||
- Removed obsolete mysql-cluster, the package should already be removed
|
||||
- Improve error message when log file is not writable
|
||||
|
||||
* Wed Jun 18 2014 Mikko Tiihonen <mikko.tiihonen@iki.fi> - 1:10.0.12-2
|
||||
- Use -fno-delete-null-pointer-checks to avoid segfaults with gcc 4.9
|
||||
|
Loading…
Reference in New Issue
Block a user