Removes tab indents for bashate
Change-Id: Ic874ca88ea14dfd53f38f202545786cd56f56c28
This commit is contained in:
parent
dd9261de8c
commit
928ffa071d
@ -44,11 +44,11 @@ export HOME=/etc/mysql/
|
|||||||
#
|
#
|
||||||
# Usage: void mysqld_get_param option
|
# Usage: void mysqld_get_param option
|
||||||
mysqld_get_param() {
|
mysqld_get_param() {
|
||||||
/usr/sbin/mysqld --print-defaults \
|
/usr/sbin/mysqld --print-defaults \
|
||||||
| tr " " "\n" \
|
| tr " " "\n" \
|
||||||
| grep -- "--$1" \
|
| grep -- "--$1" \
|
||||||
| tail -n 1 \
|
| tail -n 1 \
|
||||||
| cut -d= -f2
|
| cut -d= -f2
|
||||||
}
|
}
|
||||||
|
|
||||||
## Do some sanity checks before even trying to start mysqld.
|
## Do some sanity checks before even trying to start mysqld.
|
||||||
@ -83,12 +83,12 @@ mysqld_status () {
|
|||||||
|
|
||||||
if [ "$1" = "check_alive" -a $ping_alive = 1 ] ||
|
if [ "$1" = "check_alive" -a $ping_alive = 1 ] ||
|
||||||
[ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then
|
[ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then
|
||||||
return 0 # EXIT_SUCCESS
|
return 0 # EXIT_SUCCESS
|
||||||
else
|
else
|
||||||
if [ "$2" = "warn" ]; then
|
if [ "$2" = "warn" ]; then
|
||||||
echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug
|
echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug
|
||||||
fi
|
fi
|
||||||
return 1 # EXIT_FAILURE
|
return 1 # EXIT_FAILURE
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,93 +98,93 @@ mysqld_status () {
|
|||||||
|
|
||||||
case "${1:-''}" in
|
case "${1:-''}" in
|
||||||
'start')
|
'start')
|
||||||
sanity_checks;
|
sanity_checks;
|
||||||
# Start daemon
|
# Start daemon
|
||||||
log_daemon_msg "Starting MariaDB database server" "mysqld"
|
log_daemon_msg "Starting MariaDB database server" "mysqld"
|
||||||
if mysqld_status check_alive nowarn; then
|
if mysqld_status check_alive nowarn; then
|
||||||
log_progress_msg "already running"
|
log_progress_msg "already running"
|
||||||
log_end_msg 0
|
log_end_msg 0
|
||||||
else
|
else
|
||||||
# Could be removed during boot
|
# Could be removed during boot
|
||||||
test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld
|
test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld
|
||||||
|
|
||||||
# Start MariaDB!
|
# Start MariaDB!
|
||||||
/usr/bin/mysqld_safe "${@:2}" > /dev/null 2>&1 &
|
/usr/bin/mysqld_safe "${@:2}" > /dev/null 2>&1 &
|
||||||
|
|
||||||
# 6s was reported in #352070 to be too few when using ndbcluster
|
# 6s was reported in #352070 to be too few when using ndbcluster
|
||||||
for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do
|
for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do
|
||||||
sleep 1
|
sleep 1
|
||||||
if mysqld_status check_alive nowarn ; then break; fi
|
if mysqld_status check_alive nowarn ; then break; fi
|
||||||
log_progress_msg "."
|
log_progress_msg "."
|
||||||
done
|
done
|
||||||
if mysqld_status check_alive warn; then
|
if mysqld_status check_alive warn; then
|
||||||
log_end_msg 0
|
log_end_msg 0
|
||||||
# Now start mysqlcheck or whatever the admin wants.
|
# Now start mysqlcheck or whatever the admin wants.
|
||||||
output=$(/etc/mysql/debian-start)
|
output=$(/etc/mysql/debian-start)
|
||||||
[ -n "$output" ] && log_action_msg "$output"
|
[ -n "$output" ] && log_action_msg "$output"
|
||||||
else
|
else
|
||||||
log_end_msg 1
|
log_end_msg 1
|
||||||
log_failure_msg "Please take a look at the syslog"
|
log_failure_msg "Please take a look at the syslog"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
'stop')
|
'stop')
|
||||||
# * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
|
# * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
|
||||||
# at least for cron, we can rely on it here, too. (although we have
|
# at least for cron, we can rely on it here, too. (although we have
|
||||||
# to specify it explicit as e.g. sudo environments points to the normal
|
# to specify it explicit as e.g. sudo environments points to the normal
|
||||||
# users home and not /root)
|
# users home and not /root)
|
||||||
log_daemon_msg "Stopping MariaDB database server" "mysqld"
|
log_daemon_msg "Stopping MariaDB database server" "mysqld"
|
||||||
if ! mysqld_status check_dead nowarn; then
|
if ! mysqld_status check_dead nowarn; then
|
||||||
set +e
|
set +e
|
||||||
shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
|
shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
|
||||||
set -e
|
set -e
|
||||||
if [ "$r" -ne 0 ]; then
|
if [ "$r" -ne 0 ]; then
|
||||||
log_end_msg 1
|
log_end_msg 1
|
||||||
[ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
|
[ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
|
||||||
log_daemon_msg "Killing MariaDB database server by signal" "mysqld"
|
log_daemon_msg "Killing MariaDB database server by signal" "mysqld"
|
||||||
killall -15 mysqld
|
killall -15 mysqld
|
||||||
server_down=
|
server_down=
|
||||||
for i in `seq 1 600`; do
|
for i in `seq 1 600`; do
|
||||||
sleep 1
|
sleep 1
|
||||||
if mysqld_status check_dead nowarn; then server_down=1; break; fi
|
if mysqld_status check_dead nowarn; then server_down=1; break; fi
|
||||||
done
|
done
|
||||||
if test -z "$server_down"; then killall -9 mysqld; fi
|
if test -z "$server_down"; then killall -9 mysqld; fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! mysqld_status check_dead warn; then
|
if ! mysqld_status check_dead warn; then
|
||||||
log_end_msg 1
|
log_end_msg 1
|
||||||
log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-5.5/README.Debian.gz!"
|
log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-5.5/README.Debian.gz!"
|
||||||
exit -1
|
exit -1
|
||||||
else
|
else
|
||||||
log_end_msg 0
|
log_end_msg 0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
'restart')
|
'restart')
|
||||||
set +e; $SELF stop; set -e
|
set +e; $SELF stop; set -e
|
||||||
$SELF start
|
$SELF start
|
||||||
;;
|
;;
|
||||||
|
|
||||||
'reload'|'force-reload')
|
'reload'|'force-reload')
|
||||||
log_daemon_msg "Reloading MariaDB database server" "mysqld"
|
log_daemon_msg "Reloading MariaDB database server" "mysqld"
|
||||||
$MYADMIN reload
|
$MYADMIN reload
|
||||||
log_end_msg 0
|
log_end_msg 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
'status')
|
'status')
|
||||||
if mysqld_status check_alive nowarn; then
|
if mysqld_status check_alive nowarn; then
|
||||||
log_action_msg "$($MYADMIN version)"
|
log_action_msg "$($MYADMIN version)"
|
||||||
else
|
else
|
||||||
log_action_msg "MariaDB is stopped."
|
log_action_msg "MariaDB is stopped."
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
|
echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -35,11 +35,11 @@ do
|
|||||||
case $key in
|
case $key in
|
||||||
-d|--domain)
|
-d|--domain)
|
||||||
DOMAIN="$2"
|
DOMAIN="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-p|--project)
|
-p|--project)
|
||||||
PROJECT="$2"
|
PROJECT="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
usage
|
usage
|
||||||
|
2
tox.ini
2
tox.ini
@ -28,4 +28,4 @@ commands =
|
|||||||
bash -c "find {toxinidir} \
|
bash -c "find {toxinidir} \
|
||||||
-not -path '*/\.*' \ # stay out of the dot directories
|
-not -path '*/\.*' \ # stay out of the dot directories
|
||||||
-name '*sh' \ # all shell scripts please
|
-name '*sh' \ # all shell scripts please
|
||||||
-print0 | xargs -0 bashate -v -i E002,E003,E010,E011,E020,E041"
|
-print0 | xargs -0 bashate -v -i E003,E010,E011,E020,E041"
|
||||||
|
Loading…
Reference in New Issue
Block a user