On Mon, Nov 23, 2020 at 03:19:24PM +0100, Mark Kettenis wrote: > > Date: Mon, 23 Nov 2020 13:53:01 +0100 > > From: Solene Rapenne <[email protected]> > > > > A common mistake when using dd is to create a file in /dev which > > fills up the space of / and may stay silent until / gets filled up > > by something else that will fail. > > > > Would it be OK to add this in /etc/daily? > > > > find /dev -type f ! -name MAKEDEV -delete > > > > AFAIK /dev should have only MAKEDEV as a regular file. > > hier(7) says /dev only have block and character devices > > with the exception of MAKEDEV. > > Well, the man page is lying as /dev also contains: > > - sockets (/dev/log) > - symlinks
To be fair, the -type f in solene@'s proposal would preserve all of those, and just cleanup stray normal files. This does seem to be mostly harmless, but I do wonder if silently cleaning up after a users mess is the way to go or not, and should this be done at boot instead, like the /tmp clearing? -Bryan.
