[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Removal of users takes ages on systems with many homes / many files.

[Mike Gabriel]
> This happens because the find process that searches for purgable
> dirs scans the whole hd which is not feasible on big installations.

Why is this done in the script:

  chown -R root:root $RM_HOMEDIR
  chmod go-rwx $RM_HOMEDIR

In my experience, there is no need to do the destructive recursive
ownership change, and the chmod call would be enough.  With the chown
-R in place, there is no way to properly recover the files on disk if
the user should be restored, as there is no way to know what ownership
the files had.

At the University of Oslo, we rename to .$user.removed and chmod to
mode 0 to block access, and it has been working for us for years.  We
do not change ownership of the files in the hope directory.  But we
touch the home directory to know when the user was removed.

> I have reduced the search depth to -maxdepth 1, maybe we could use a
> -maxdepth 2 in case people cascade homes (e.g. like
> /skole/tjener/home0/students, /skole/tjener/home0/teachers).

Sound like a good idea.  What about keeping an index instead, to not
have to guess where hope pages used to be?  It seem a bit risky, as it
might end up removing files in other users home directory by mistake
if it is allowed to search many levels, and might miss some if it

Happy hacking,
Petter Reinholdtsen

Reply to: