| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #!@l_prefix@/bin/openpkg rc
- ##
- ## rc.mysql -- Run-Commands
- ##
- %config
- mysql_enable="$openpkg_rc_def"
- mysql_pwd_file=@l_prefix@/etc/mysql/my.pwd
- mysql_cnf_file=@l_prefix@/etc/mysql/my.cnf
- mysql_common_prolog="true"
- mysql_common_epilog="true"
- mysql_common_numfiles="10"
- mysql_common_minsize="1M"
- mysql_common_complevel="9"
- mysql_err_prolog="true"
- mysql_err_epilog="true"
- mysql_err_numfiles="10"
- mysql_err_minsize="1M"
- mysql_err_complevel="9"
- %common
- mysql_pid_file=@l_prefix@/var/mysql/mysqld.pid
- mysql_err_log=@l_prefix@/var/mysql/mysqld.err
- mysql_common_log=@l_prefix@/var/mysql/common.log
- %status -u @l_susr@ -o
- mysql_usable="unknown"
- mysql_active="no"
- HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
- --defaults-extra-file=${mysql_pwd_file} \
- ping >/dev/null 2>&1 && mysql_active="yes"
- if [ $mysql_active = "no" -a -f $mysql_pid_file ] ; then
- kill -0 `cat $mysql_pid_file` && mysql_active="unknown"
- fi
- echo "mysql_enable=\"$mysql_enable\""
- echo "mysql_usable=\"$mysql_usable\""
- echo "mysql_active=\"$mysql_active\""
- %start -p 400 -u @l_rusr@
- rcService mysql enable yes || exit 0
- rcService mysql active yes && exit 0
- cd @l_prefix@
- @l_prefix@/bin/mysqld_safe >/dev/null 2>&1 \
- --pid-file="$mysql_pid_file" \
- --log-error="$mysql_err_log" &
- %stop -p 600 -u @l_susr@
- rcService mysql enable yes || exit 0
- rcService mysql active no && exit 0
- HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
- --defaults-extra-file=${mysql_pwd_file} \
- flush-logs
- HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
- --defaults-extra-file=${mysql_pwd_file} \
- shutdown
- %restart -p 400 -u @l_susr@
- rcService mysql enable yes || exit 0
- rcService mysql active no && exit 0
- rc mysql stop start
- %daily -u @l_susr@
- rcService mysql enable yes || exit 0
- rcTmp -i
- hintfile=`rcTmp -f -n hint`
- shtool rotate -f \
- -n ${mysql_common_numfiles} -s ${mysql_common_minsize} -d \
- -z ${mysql_common_complevel} -m 660 -o @l_rusr@ -g @l_rgrp@ \
- -P "${mysql_common_prolog}" \
- -E "${mysql_common_epilog}; echo 1 >$hintfile" \
- ${mysql_common_log}
- shtool rotate -f \
- -n ${mysql_err_numfiles} -s ${mysql_err_minsize} -d \
- -z ${mysql_err_complevel} -m 660 -o @l_rusr@ -g @l_rgrp@ \
- -P "${mysql_err_prolog}" \
- -E "${mysql_err_epilog}; echo 1 >$hintfile" \
- ${mysql_err_log}
- if [ -s $hintfile ]; then
- rc mysql restart
- fi
- rcTmp -k
|