I have installed apache2 package in Debian. In addition to the startup script /etc/init.d/apache2, there is also another one:


What is the purpose of this script? The description says:

# Short-Description: Cache cleaner process for Apache2 web server
# Description:       Start the htcacheclean helper
#  This script will start htcacheclean which will periodically scan the
#  cache directory of Apache2's mod_cache_disk and remove outdated files.

so it looks like some maintenance script that cleans cache. Why is it then in /etc/init.d/, where usually only startup scripts reside.

Also the format of this script looks different from standard startup script.

So I am confused;

  1. why is it in /etc/init.d/
  2. what does it do
  3. who is calling this script
  4. how can I check whether I am actually using this script
  5. where is the "cache directory of Apache2's mod_cache_disk", that is mentioned in the description
  6. what will happen if I delete it from /etc/init.d/ ?

As should be clear from my question, I am using sysvinit.

1 Answer 1


by default

By default, this script serves no function. The existence of the apache-htcacheclean.service unit file completely obviates its entire function, and systemd ignores it.

when the van Smoorenburg system is in use

When the van Smoorenburg init+rc system is in use, this script does exactly what the comment says: it starts the htcacheclean program, which has doco supplied by Apache. It is invoked by van Smoorenburg rc in the same usual way that the other rc scripts are, as a result of the usual symbolic link farm (or file-rc file) maintained for that system in /etc/rc*.d/. It is just like other modern-form van Smoorenburg rc scripts, whose "new" (as of 2014) format is documented in the manual.

And where the cache directory is, is a configuration parameter for the service, set by you (with a default), named HTCACHECLEAN_PATH.

Further reading

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .