chr-1x / ananas

The Python Bot Framework for Mastodon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

if file system is full, shutting down bot empties config file

puphime opened this issue · comments

see above, thankfully i had a copy of it elsewhere

Full filesystem will mess up your system in many ways. In this case, ananas tries to write the config file but the system won't let it; there's very little that can be done.

Just pushed to master and to pypi a fix for this. Basically what we can do is try to write to a tempfile, then replace the user config with that if it succeeds. That way if the fs is full the write to the tempfile will fail first without touching the user config.

Does this fix work properly if the tempfile is on a different filesystem, like tmpfs?

It should, since the call to replace should fail, but: yes, as a precaution I think it makes sense to write the provisional config update to the same folder as the user config file.

Fixed in 0cc76e7