Opened 9 years ago
Closed 8 years ago
#12964 closed Bug Report - General (fixed)
run-parts: /etc/cron.weekly/mythtv-database exited with return code 2
| Reported by: | Owned by: | ||
|---|---|---|---|
| Priority: | minor | Milestone: | unknown |
| Component: | Packaging | Version: | 0.28.0 |
| Severity: | medium | Keywords: | |
| Cc: | Ticket locked: | no |
Description
The mythtv backup scripts exists with error code 2 and does no backup if root has an .my.cnf file for mysqldump with different user.
The reason is already described in then code of "mythconverg_backup.pl":
verbose($verbose_level_debug,
'', "Attempting to use supplied password for $mysqldump.",
'Any [client] or [mysqldump] password specified in the MySQL'.
' options file will',
'take precedence.');
By reading the /etc/default/mythtv-backend file and using sudo if the mythv user is set,this could be solved:
#!/bin/sh
# /etc/cron.weekly/mythtv-database script - check and backup mythconverg tables
# Copyright 2005/12/02 2006/10/08 Paul Andreassen
# 2010 Mario Limonciello
set -e -u
DBNAME="mythconverg"
DEBIAN="--defaults-extra-file=/etc/mysql/debian.cnf"
/usr/bin/mysqlcheck $DEBIAN -s $DBNAME
if [ -e "/etc/default/mythtv-backend" ]; then
. /etc/default/mythtv-backend
fi
if [ "$USER" = "" ]; then
CMDPREFIX=""
else
CMDPREFIX="sudo -u $USER"
fi
$CMDPREFIX /usr/share/mythtv/mythconverg_backup.pl
/usr/bin/logger -p daemon.info -i -t${0##*/} "$DBNAME checked and backed up."
# End of file.
the changed code is:
if [ -e "/etc/default/mythtv-backend" ]; then . /etc/default/mythtv-backend fi if [ "$USER" = "" ]; then CMDPREFIX="" else CMDPREFIX="sudo -u $USER" fi $CMDPREFIX /usr/share/mythtv/mythconverg_backup.pl
Change History (3)
Note:
See TracTickets
for help on using tickets.

Pull request https://github.com/MythTV/packaging/pull/69