Closed tukoz closed 6 years ago
Sounds like the user dnsmasq needs to be reloaded. Turn off dnsmasq, wait a couple seconds, and then turn dnsmasq back on. There's a Pam command somewhere that can do this too, but at the moment I can't find it (would be a nice addition to the install script).
Thanx gaesenrich but actually dnsmasq keeps failing to load names from /var/lib/hostsblock/hosts.block whether I turn it off & on again, or restart my box.
hmm...now that is a puzzler. I'm assuming that your permissions remain the
same after reboot. Maybe /var/lib
has a permission issue (should be
chmod 755). It doesn't look like you are using ACLs or MAC (à la SELinux).
As a work around, you could change hosts.block to world-readable, e.g. add
the following line to hostsblock.conf
:
postprocess() {
chmod 644 $HOME/hosts.block
sudo systemctl reload dnsmasq.service
}
And make sure that /var/lib/hostsblock
(and its parent directories) are
world readable and executable (the latter allows contents to be seen).
Hi, I have the same problem (using v0.999.6-3 on Arch), but your workaround seems to do the trick for me:
# systemctl status dnsmasq.service
...
Aug 16 20:18:52 xyz dnsmasq[1801]: read /var/lib/hostsblock/hosts.block - 665838 addresses
Still, I don't really understand why it did not work before. The file permissions are correct, and I can execute e.g. sudo -u dnsmasq tail /var/lib/hostsblock/hosts.block
without problems. Also, sudo dnsmasq --no-daemon
works fine, i.e. running as root without dropping privileges. But manually calling sudo dnsmasq -k -u dnsmasq
(essentially what the systemd unit does) leads to "no permission" again.
Anyway, this does not seem to be a problem with hostsblock itself, right? Maybe we should check with the dnsmasq people. I'm currently using dnsmasq 2.77, how about you?
Oddly enough, my /var/lib/hostsblock
was at 750. Changed it to 755. dnsmasq
can now access.
Running Arch. Installed hostsblock
AUR package.
Hopefully fixed in 1a272e22638661f0f527310937189383a75bd2d1
On Arch linux, hostsblock v0.999.4-1.
/var/lib/hostsblock/hostsblock.conf
$ ls -ld /var/lib/hostsblock/
drwxr-x--- 3 hostsblock hostsblock 4096 juil. 28 12:26 /var/lib/hostsblock/
ls -l /var/lib/hostsblock/
/etc/group
hostsblock:x:1013:hostsblock,dnsmasq
$ ll -d /var/lib/hostsblock
drwxr-x--- 3 hostsblock 4,0K juil. 28 12:26 /var/lib/hostsblock/
Looks like I missed something. Note I haven't removed /etc/hostsblock dir yet.