RE: Re-checking disk cache

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Wed, 11 Oct 2000 11:03:14 +0200

On 11 Oct 2000, at 9:27, Chemolli Francesco (USI) <ChemolliF@GruppoCredit.it> wrote:

> > > And then some more: I'm using Linux, and I'm an happy
> > > diskd user. I've heard voices of aufs being potentially faster
> > > on Linux, but I can't use it, the SIGUSR* would be
> > > lost and I _need_ logfile rotation.

 squid under linux threads moves signals to overcome this:
#ifdef _SQUID_LINUX_THREADS_
                opt_send_signal = SIGQUIT;
#else
                opt_send_signal = SIGUSR1;
#endif
            else if (!strncmp(optarg, "debug", strlen(optarg)))
#ifdef _SQUID_LINUX_THREADS_
                opt_send_signal = SIGTRAP;
#else
                opt_send_signal = SIGUSR2;
#endif

 So squid -k should still work. It doesn't?

> > > How hard would it be to implement some other scriptable
> > > control interface? For instance, a named pipe would be
> > > quite OK with squid's overall model, and it would cost only
> > > one FD.
> >
> > Uhm, you mean a control channel to do logfile rotation? Hrm. I think
> > that might be a candidate for a cachemgr + acl option. Look t adding
> > a cachemgr option to do it, it can't be that difficult (look at the
> > code that toggles the offline mode to see how to implement
> > the cachemgr
> > interface) and send patches to -HEAD this way.
>
> Not only logfile rotation, but just basically anything that
> can be done to squid via signals nowadays, and them some more.
>
> cachemgr is fine, but it's not scriptable. Not easily at least.

 Why not? You don't actually need web server and cachemgr.cgi for that:
   client -h yourcache -p 3128 cache_object://cache/info@ gives you
 general Info page, cache_object://cache/rotatelogs@passwd could do
 rotation if implemented.

> Now let's suppose that we designed a tiny protocol that worked like this:
>
> one command per line (commands are terminated by lf, cr is ignored).
> Each command has to be prefixed by the correct cachemgr (or another)
> password.
> Commands are basically wordlists.
> Commands are read from a socket, for instance /var/run/squidctl
>
> To logrotate from a script, you just
> echo "foo logrotate" >/var/run/squidctl
>
> To shutdown
> echo "foo shutdown" >/var/run/squidctl

 I'd rather propose to use cache_object: interface.
 cache_object://cachehost/squidctl/rotatelogs@passwd
 cache_object://cachehost/squidctl/shutdwon@passwd
 etc...
 Should be much easier to implement

> Two levels of permissions checking: the permissions on the
> socket, AND knowledge of the admin password.
>
> squid -k whatever could be redone to use this interface.

 signalling isn't totally replaceable. signals work even if
 parts of squid are hung.

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 Delfi Online
 Tel: 6501 731, Fax: 6501 708
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Wed Oct 11 2000 - 03:06:06 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:42 MST