On my machine root keeps getting email from cron saying "rm: cannot
unlink `/var/cache/man/cat8/(whatever).gz': Permission denied".
I've traced this behaviour to the man-db cron job trying to remove
stale files from the /var/cache/man tree while running as user 'man',
because running the command mannualy with '--chuid man' generates the
error messages, while using '--chuid root' makes it succeed.
The strange thing about this is that the cached man files are owned by
'man', so why should the rm command fail when run as user 'man'?
Further inspection shows that the /var/cache/man directories are SGID
root, and the cached files are owned by user 'man' and group 'root'
(instead of group 'users'). Unfortunately I don't know what a "SGID
directory" means, so I can't relate it to my problem.
I could solve this matter by either:
1) changing the man-db cron file so that the command is run as root
(inelegant),
2) removing the SGID bit from the /var/cache/man directory and
subdirectories (seems dangerous)
Could you advise on a better solution?
TIA
Carlos