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

Re: dns cache for localdomain via djbdns



Greg Wooledge wrote: 
> On Wed, Aug 12, 2020 at 02:59:23PM +0200, Patrick Frank wrote:
> > Hello,
> > 
> > on a Debian 10 host I created a virtual machine with very basic features
> > to build a dns cache for my home network with djbdns. I fail to understand
> > how Daemontools are used properly.
> > 
> > Following the instructions on http://cr.yp.to/djbdns/install.html went okay.
> > http://cr.yp.to/djbdns/run-cache-x.html at step 5 is where I am stuck.
> > 
> > When I go to /service/dnscache and execute "run" it says "starting" so I
> > try svstat /service/dnscache which outputs:
> > "/service/dnscache: unable to open supervise/ok: file does not exist"
> 
> You can execute the "./run" script by hand for testing purposes, to
> make sure you've written it correctly, but that's not how daemontools
> will run it.  If your test is successful, you should Ctrl-C (or otherwise
> terminate) the ./run script that you ran manually.  Make sure it dies.
> 
> You tell daemontools to run the service by creating a symbolic link
> from the /service directory to the directory where the run script
> lives.
> 
> For example:
> 
> unicorn:~$ ls -l /service
> total 0
> lrwxrwxrwx 1 root root 13 Jan 12  2018 dnscache -> /etc/dnscache/
> lrwxrwxrwx 1 root root 39 Jan 12  2018 qmail-deliverabled -> /var/qmail/supervise/qmail-deliverabled/
> lrwxrwxrwx 1 root root 31 Jan 12  2018 qmail-send -> /var/qmail/supervise/qmail-send/
> lrwxrwxrwx 1 root root 28 Jan 12  2018 qpsmtpd -> /var/qmail/supervise/qpsmtpd/
> 
> unicorn:~$ ls -l /etc/dnscache/
> total 24
> drwxr-sr-x 2 root root 4096 Jan 12  2018 env/
> drwxr-sr-x 4 root root 4096 Jan 12  2018 log/
> drwxr-sr-x 4 root root 4096 Jan 12  2018 root/
> -rwxr-xr-x 1 root root  142 Jan 12  2018 run*
> -rw------- 1 root root  128 Jan 12  2018 seed
> drwx--S--- 2 root root 4096 Aug  2 09:00 supervise/
> 
> The presence of the symlink /service/dnscache is picked up by svscan,
> which launches a supervisor process.

This is all correct, but in addition:

svc -d /service/dnscache
  brings it down via the supervisor, similar to the action of
"service dnscache stop" or "/etc/init.d/dnscache stop"

svc -u /service/dnscache
  should start running it again

All of this clashes with manual invocation of ./run, so that has
to be killed before daemontools can take over.

-dsr-


Reply to: