[systemd-devel] preparing unit definition for squid – some questions

Tomasz Torcz tomek at pipebreaker.pl
Fri Nov 26 03:02:47 PST 2010


On Thu, Nov 25, 2010 at 09:31:55PM -0200, Gustavo Sverzut Barbieri wrote:
> On Thu, Nov 25, 2010 at 7:43 PM, Tomasz Torcz <tomek at pipebreaker.pl> wrote:
> > Hi,
> >
> >  I'm slowly porting init scripts of software I use to systemd unit files.
> > It is generally straight-forward, but today Squid made me wonder.
> >
> >  Squid is web-caching daemon (proxy) with some pecularities.  It
> > stores the cache of the internet in some directories on disk.  To
> > paralleize access, it is recommended to define separate cache_dir for
> > each hard disk. Also, squid likes 2-level deep folder structure
> > in each cache_dir, to implement simple hashing and deal with lesser
> > filesystems.
> >
> >  Populating each defined cache_dir can be slow operation, therefore
> > it is not done automatically.  Fedora's squid script checks if cache_dir
> > is empty and if so, run the command to create folder hierarchy.
> 
> IMHO this is totally wrong, we're trying to solve the problem
> elsewhere. Squid itself should check and generate the missing
> directories as it will already have to load the configuration file and
> (probably) the cache directory structure. This is even more true that
> it shouldn't assume all directories exist if at least one is there
> (ie: it is not empty, but not all required are there).

  Well, but the Squid won't generate them on normal startup and
I'm trying to not lose functionality from original sysv script.
Squid will create directiories when asked to (`squid -z`) but
it will take time and is special case, hence supplementary unit file.

  It's not a precedent. NTPD's sysv script was split during port
to run ntpdate as separate unit.  udev's was even split into 3
services.
  

-- 
Tomasz Torcz                        To co nierealne -- tutaj jest normalne.
xmpp: zdzichubg at chrome.pl          Ziomale na życie mają tu patenty specjalne.



More information about the systemd-devel mailing list