Open blightbow opened 9 years ago
Comment #1 originally posted by ZetaMUCK on 2014-10-19T00:15:23.000Z:
On further research, this is basically a long chain of fail that we've inherited from upstream Proto.
Temporary workaround: create a backup/data directory. This will ensure that you have backup rotations no matter what, but the root cause still needs to be addressed: the directory location that these database files are being written to should be in no way influenced by how the game is started up.
Comment #2 originally posted by ZetaMUCK on 2014-10-19T20:28:20.000Z:
This issue was updated by revision r120.
Added game/backup/data/ subdir to trunk as a breakfix for people starting new sites.
Akari reported another variant of this bug. The current restart script will pass in absolute paths to proto.db and proto.new as a result of directory autodetection. The backup code expects the path to the passed in database files to be relative, not absolute. This results in backup filenames that look like this:
(gdb) print (char *)fromfile
$7 = 0x7ffd64cb3d00 "backup//home/motm/motm/staging/game/data/proto.new.#9#"
(gdb) print (char *)destfile
$8 = 0x7ffd64cb3b00 "backup//home/motm/motm/staging/game/data/proto.new.#10#"
The end result is that the restart script prevents backups from being written even if the backup/data directory exists. This code should be rewritten to utilize logic similar to how paths are constructed to files in the muf and info directories.
Original issue 37 created by ZetaMUCK on 2014-10-18T21:01:24.000Z:
The problem is inside of dump_database_internal():
If the game is started with a dumpfile containing a directory path (which the current restart script does; I deliberately moved the database files back to the data directory), the rename() call will end up failing as this directory path does not exist inside of the backup directory.
fromfile and destfile need to be defined in a way that strips out only the filename component of dumpfile.