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

Bug#998438: invalidate caches on package removal



control: tag -1 + moreinfo

Hi,

On 2021-11-04 10:19, Harald Dunkel wrote:
> Package: nscd
> Version: 2.31-13+deb11u2
> 
> The nscd.prerm script should cleanup the caches
> 
> 	nscd -i {group,hosts,netgroup,passwd,services}
> 	rm -f /var/cache/nscd/{group,hosts,netgroup,passwd,services}
> 
> to invalidate and remove all caches, before the service is stopped
> and removed.

What is the reason to remove the cache in the prerm? The cache is
removed in the postrm when the --purge option is used, as specified by
the policy.

> The nscd -i is necessary to tell running processes about the change.
> They might keep these cache files open with a local file descriptor,
> even if they are erased.

The nscd process is stopped before the package is removed (in the
prerm), so it will stop using those cache files when the postinst script
is ran.

> You might want to consider to move /var/cache/nscd to /run.

/run is a tmpfs filesystem backed by RAM, which might be limited, and
thus not designed to hold caches. While on most system the nscd cache is
relatively small, it might get relatively big on some system.

Regards,
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net


Reply to: