Discussion:
[Dnsmasq-discuss] Working on read-only drive
Jan Juráň
2018-06-13 20:34:08 UTC
Permalink
Hello guys,

I have Raspberry Pi 3 with minimal raspbian image based on jessie and I
use it as access point. I did that using this tutorial:

https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md


The thing is that I made / read-only to prevent any possible corruption
caused by power loss. Now the problem of course is that dnsmasq fails to
open the lease file for writing and I get the following error:

dnsmasq: cannot open or create lease file /var/lib/misc/dnsmasq.leases:
read-only file system

Note that in my case, I do not care if I get another IP next time I
connect - it's not important at all.

Now as I see it, I have several options:

* disable somehow leasing so that dnsmasq doesn't fail on startup
* Persuade dnsmasq to search for the lease file elsewhere (I still
have rw home)
* Mount the file somehow to RAM disk

What would be the best solution and how to do it? Any ideas? And yeah, I
am a Linux noob...


Thanks
Weedy
2018-06-14 00:51:01 UTC
Permalink
Stick it on whatever tmpfs is already mounted. Thats what LEDE/OpenWRT do.
Geert Stappers
2018-06-14 07:40:20 UTC
Permalink
On Wed, Jun 13, 2018 at 08:51:01PM -0400, Weedy wrote:
> On Wed, Jun 13, 2018 at 10:34:08PM +0200, Jan Jurá?? wrote:
> >
> > I have Raspberry Pi 3 with minimal raspbian image based on jessie
> > and I use it as access point.
> >
> > The thing is that I made / read-only to prevent any possible
> > corruption caused by power loss. Now the problem of course is that
> > dnsmasq fails to open the lease file for writing and I get the
> > following error:
> >
> > dnsmasq: cannot open or create lease file
> > /var/lib/misc/dnsmasq.leases: read-only file system
> >
> > Now as I see it, I have several options:
> >
> > * disable somehow leasing so that dnsmasq doesn't fail on startup
> > * Persuade dnsmasq to search for the lease file elsewhere (I still
> > have rw home)
> > * Mount the file somehow to RAM disk
> >
> > What would be the best solution and how to do it? Any ideas?
> Stick it on whatever tmpfs is already mounted. Thats what LEDE/OpenWRT do.

How is it done? A symlink? If yes, what.


Groeten
Geert Stappers
--
Leven en laten leven
Lindgren Fredrik
2018-06-14 08:26:51 UTC
Permalink
This post might be inappropriate. Click to display it.
Jan Juráň
2018-06-14 16:06:14 UTC
Permalink
Yeah, I was hoping there would be something like this option. And I was
trying to google it, but obviously wasn't successfull with that man page.

Thanks!

I have also tried to make a symlink to /home and that works as well.

Dne 14.06.2018 v 10:26 Lindgren Fredrik napsal(a):
>
> dnsmasq has command line option:
>
> -l, --dhcp-leasefile=<path>
>
>
> or in config file:
>
> dhcp-leasefile=/var/lib/misc/dnsmasq.leases
>
>
> if you want more details try "man dnsmasq" or example config file
> provided (at least on ubuntu)
>
> /Fredrik
>
> ------------------------------------------------------------------------
> *Från:* Dnsmasq-discuss
> <dnsmasq-discuss-***@lists.thekelleys.org.uk> för Geert Stappers
> <***@stappers.nl>
> *Skickat:* den 14 juni 2018 09:40
> *Till:* dnsmasq-***@lists.thekelleys.org.uk
> *Ämne:* Re: [Dnsmasq-discuss] Working on read-only drive
> On Wed, Jun 13, 2018 at 08:51:01PM -0400, Weedy wrote:
> > On Wed, Jun 13, 2018 at 10:34:08PM +0200, Jan Jurá?? wrote:
> > >
> > > I have Raspberry Pi 3 with minimal raspbian image based on jessie
> > > and I use it as access point.
> > >
> > > The thing is that I made / read-only to prevent any possible
> > > corruption caused by power loss. Now the problem of course is that
> > > dnsmasq fails to open the lease file for writing and I get the
> > > following error:
> > >
> > > dnsmasq: cannot open or create lease file
> > > /var/lib/misc/dnsmasq.leases: read-only file system
> > >
> > > Now as I see it, I have several options:
> > >
> > >  * disable somehow leasing so that dnsmasq doesn't fail on startup
> > >  * Persuade dnsmasq to search for the lease file elsewhere (I still
> > >    have rw home)
> > >  * Mount the file somehow to RAM disk
> > >
> > > What would be the best solution and how to do it? Any ideas?
> > Stick it on whatever tmpfs is already mounted. Thats what
> LEDE/OpenWRT do.
>
> How is it done?    A symlink? If yes,  what.
>
>
> Groeten
> Geert Stappers
> --
> Leven en laten leven
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-***@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> Dnsmasq-discuss Info Page
> <http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss>
> lists.thekelleys.org.uk
> A list for discussion about the dnsmasq DNS and DHCP server.
> Configuration, bugs and development. To control spam, only subscribers
> are allowed to post to the list.
>
>
>
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-***@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Continue reading on narkive:
Loading...