implemented custom --defaults-file
This PR attempts to provide a better way to access DB safely. Currently there are two options, either:
- pass USER and PASSWORS via CLI parameters, or
- use
/etc/mysql/debian.cnf
as--defaults-file
.
The first approach (CLI params) is considered unsecure, as the password gets exposed to other users via process list. The second approach is acceptable, but has a flaw that the /etc/mysql/debian.cnf
path is a hard-coded in automysqlbackup and the /etc/mysql/debian.cnf
is now OBSOLETE and will be removed in future Debian versions.
This PR makes the --defaults-file
configurable. It introduces $DEFAULTSFILE
variable that may be set in /etc/default/automysqlbackup
. The variable is set to "/etc/mysql/debian.cnf"
by default.