I have a service daemon that creates a lot of temp files. Recently my server died, because a malicious user managed to flood /tmp and fill up the disk. I have taken some measures to actively clean up the temp dir, but additionally I would like to constrain the max size of this applications temp dir.
Is there any way I can create dir, say,
/apptmp that will never be larger than e.g. 10G? I know I can set disk limits by-user, but I just want to limit this tmpdir; the application should always be able to write elsewhere.
I am running Ubuntu Linux 12.04.
edit: All of this should eventually be wrapped up in an installable Ubuntu package though. So I don't think I want to rely on modifying the partitions, unless I can somehow simulate it.