[Dnsmasq-discuss] Permission denied on logfile

Johannes Stezenbach js at sig21.net
Wed Sep 22 06:54:12 UTC 2021


On Tue, Sep 21, 2021 at 09:40:17PM +0100, Simon Kelley wrote:
> On 21/09/2021 20:54, Johannes Stezenbach wrote:
> > This works the first time, but fails after dnsmasq is restarted:
> >   dnsmasq: cannot open log /tmp/dnsmasq.log: Permission denied
> > 
> > $ ls -l /tmp/dnsmasq.log
> > -rw-r----- 1 dnsmasq root 515 Sep 20 21:50 /tmp/dnsmasq.log
> > 
> 
> I think this is because the /tmp/directory has the sticky bit set. The
> file is owned by user dnsmasq, but it's opened whilst dnsmasq is still
> running as root, and that may fail in a stick-bit directory. What
> happens if you put the log file somewhere else?

Ah, you're right, it works in /var/log/dnsmasq.log.


Thanks,
Johannes



More information about the Dnsmasq-discuss mailing list