Signal Help

I have OpenVPN Server,
whenever new client appears, I am running a script which should append the IP of the client, name in say local.list.
then I am sending realtime signal 4 using below command

sudo pkill -SIGRTMIN+4 pihole-FTL

Is there a way to see if this executed, and resulting logs from pihole/ftl ?
If my intention is to see the client name rather than the IP address, is the signal I am sending right ? or should I send real time signal 3 sudo pkill -SIGRTMIN+3 pihole-FTL instead ?
I see alias-client only once in entire documentation without explanation, what is it?

Look in file /var/log/pihole/FTL.log

Would the command below better suit your needs?

pihole restartdns

Full restart Pi-hole subsystems

Problem with pihole restartdns is cache will be erased and partly defeats the purpose of pihole.

You can read about how FTL reacts to different signals here:

It is not creating any more logs there rather than just initial logs.

There should be a line like

[2023-03-18 14:17:09.520 578267M] Received: Real-Time Signal 4 (38 -> 4)

in /var/log/pihole/FTL.log

There is no need to send any signals as FTL can use inotify to fully automatically monitor files specified inside a hostsdir.

Quoting man dnsmasq:

Read all the hosts files contained in the directory. New or changed files are read automatically and modified and deleted files have removed records automatically deleted.

My proposal is now to create a directory, e.g. /opt/openvpn/, add a file /opt/openvpn/hosts and append/remove from this list. Then create a new file, e.g. /etc/dnsmasq.d/99-custom-hosts.conf with content


and run pihole restartdns.

Whenever hosts are now added (or removed) from your new list, you will see log lines like

Mar 19 07:38:52 dnsmasq[1237595]: inotify: /opt/openvpn/hosts new or modified
Mar 19 07:38:52 dnsmasq[1237595]: read /opt/openvpn/hosts - 2 names

This comes not only at the benefit of not needing to send any signals but also with letting your DNS cache stay intact.

1 Like

Brilliant, this is exactly what I want.
It is working like a charm.
addn-hosts doesn't seem to have this ability to monitor and update. {edit}

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.