Request to move the default temp directory on Debian 13

SYSTEM INFORMATION
OS type and version Debian 13
Webmin version Webmin 2.610
Virtualmin version 7.50.2 GPL
Webserver version -
Related packages -

Hi, yesterday I upgraded my last 7 servers to Debian 13. And today I got some emails, that the SSH backup didn’t finish, in fact almost always the very first domains were failing, by chance those being bigger ones. The error was:

    Creating differential TAR file of home directory ..
    .. TAR failed : cat: write error: No space left on device

gzip: stdout: Broken pipe
/bin/tar: -: Wrote only 2048 of 10240 bytes
/bin/tar: Error is not recoverable: exiting now

So it seems clear that it was a space issue, but not very clear why, as both the guest VM and the destination had plenty of room > 50%. So I took a look at the mounts and I started a backup to simulate the problem, and the 3.9GB /tmp mount was growing quickly till it got full and the backup stopped. Memory usage accordingly.

I remembered reading about some changes in Debian 13 and yes, the /tmp is now in RAM, limited by a certain percent in a systemd file.

As backups can be quite big (got a domain with more than 40GB, archived) it is surely a problem for backups. And… RAM should be used for other stuff, not backups for sure.

Would you consider moving the default temp dir from /tmp/.webmin to /var/tmp/.webmin as this one resides on drives? In my case was solved by creating the folder and changing the setting in Webmin’s configuration options. I wouldn’t completely bypass the new direction of Debian, as explained and suggested here, only for very low RAM machines A Deep Dive Into Debian 13's /tmp: What's New, And What To Do If You Don't Like It - LowEndBox

Or maybe you can find another creative way?

Thank you for reading this!

Don’t use partitions other than swap and / ? Back in the ‘bad ole daze’ of ext2 losing data on a partition was common so segregating them made more sense. I personally don’t know if there is a good reason now that we have journaling file systems to continue the partitions as used in the past. I know where I rent my server they don’t give an option. You pretty much have to go with the file system they create. :frowning:

See “Webmin ⇾ Webmin Configuration: Advanced Options”.

Yes I know, as I said, that is exactly what I did; but /tmp/.webmin being generally unusable with Virtualmin because of this change, I was proposing to change the default.

That is not it - that /tmp dir is mounted in RAM. That is the Debian 13 default.
I have my own servers and never make a /tmp partition for this reason anyways. So I didn’t have one, and still hit this rock :roll_eyes:

Thanks. I missed that one. I guess no more /tmp cleanup. :smiley:

So, if you move it to /var/tmp/… then does the cleanup become your responsibility? @Ilia Does Webmin clean up sufficiently after itself?

@Jamie, what do you think about it?

What kind of clean up are you thinking about?

Most distributions use tmpfs for /tmp in RAM, by default, though I think most hosting providers don’t do that for their VMs. But, we probably shouldn’t assume /tmp is large, even if it’s not in RAM.

/var/lib/webmin is probably a more appropriate place for this kind of thing.

Not leaving stale files in the tmp directory.

Yes, Webmin has a setting for how long should keep files. Worked fine for me.

1 Like

@Joe maybe /var/tmp/.webmin and not /var/lib could be better, as it is a proper folder for temp files and the OSes know about this one, so it gets cleaned automatically after like 30 days if by any chance Webmin or any other piece of software misses something?

Because I have horror stories with temps and logs folders growing like crazy :grinning_face:

2 Likes

Yeah, that’s true. I was thinking exclusively about backups, which feel weird to put in any tmp directory. But, Webmin defaults to putting backups and all other temporary files into its temp dir…so, we are talking about things that obviously should be in some system tmp directory, in addition to backups.

We could certainly change the default location for tmp files if /tmp is mounted from a small RAM disk.

When a backup is created in tmp are the permissions as such to prevent unwanted users probing and accessing the backup files?

you have such on your system :ogre:

only me on mine, but while the team was looking at this there is no harm making sure there is not a potential attack vector.

agree - but i trust the team to do that anyway if you do not have a level of trust in the team then why are we even here :ghost:

i am not on about the team. :smiley:

If a file is created in the /tmp folder it is potentially available to all virtual-server users and if you know the format of backup file name of other users (not impossible to get) then you can potentially probe a known file location i.e. /tmp/ and then that 3rd party virtual-server user can then download that backup file.

then that would be true wherever the backup file is placed (even where it is placed now)

i don’t think so. if you have the backups in a specified folder (eg /tmp/webmin-backups) then you can add specific permissions to that folder to which only allow the system to access it. You cannot do this on the /tmp/ folder because of the nature of it.