I have been struggling with that message a lot during backup and also restore tasks.
Until I changed Webmin/Virtualmin to not make use of the path /tmp anymore. Per default, /tmp is mounted as ramdisk (tmpfs) and Webmin seems to fill up the ram and and swapfile during certain operations.
Yes I did that and since then backup and restore works.
However, a default Webmin installation should not use a ramdisk mount if large files need to be extracted or processed there. This is a bug report.
How would you expect this issue to be handled, though? A user can create a non-ramfs /tmp directory before installing Virtualmin, which is large enough and works as expected.
Do you want to show a wizard step when the /tmp directory is too small or uses ramfs so the user can easily change it?
I really thought Jamie said heād update Webmin to automatically use /var/tmp if /tmp is a RAM file system. If thatās not what was decided, we probably should.
@Jamie, what are your thoughts on it? I think this is a reasonable idea, considering we actively use the temp files directory for large operations like backups.
/var/tmp is probably fine as long as itās not mounted as tmpfs as well. Yet, a better option would likely be /var/cache/webmin for that purpose?
This is something we could check at Webmin install time for sure, although I havenāt done it yet. Using another directory is a bit risky because it potentially may not be accessible by non-root users depending on permissions though - but /var/tmp seems like it should always be usable.
Actually maybe we should separate temp files used for backups (which can be large) from smaller temp files used to capture output from commands?
What value would there be in making a split? Why not just create a directory we control, like /var/cache/webmin, with the permissions we need? We could then sandbox each userās temp files, such as /var/cache/webmin/0, /var/cache/webmin/1000, etc., with stricter permissions on the containing directory?
@Jamie, no problem, I fixed it in the following commits:
And, after checking further, I remembered that there are indeed some cases where the parent directory needs to be writable by the user. So, to my disappointment, we wonāt be able to use /var/cache. However, using /var/tmp still solves the original.
Please let me know if you see any potential issues with these changes, or if weāre good?
@Jamie, however, I think we could still use /var/cache, but weād first need to create a world writable directory such as /var/cache/webmin with the sticky bit set. Then, we could write files to a subdirectory based on the user ID, for example /var/cache/webmin/0 or /var/cache/webmin/1000, and so on.
What do you think of this idea? Do you want me to implement that?
/var/cache seems wrong, as weāre not creating cache files like would be done by something like Squid. These are just temporary files, so a better location would be /var/tmp or maybe /var/webmin/tmp . And thereās no need to go for a complex solution like per-user files, as we already have a perfectly workable solution for the /tmp/.webmin directory.