Using a separate partition for /var breaks ubus and/or services

I would like to have a separate partition for /var and have configured this in /etc/config/fstab. It mounts perfectly but none of the services are running. For example:

root@OpenWrt:~# service network status
Failed to connect to ubus
Failed to parse json data: unexpected end of data
inactive

If I kill ubusd ( kill -9 $(pidof ubusd) ) the warnings above go away. When I remove my /var mount all services start normally.

It seems to me the /var mounting happens too late in the boot process, breaking services. Has anyone else attempted this? Where should /var be mounted (preinit?)

Thanks!

It should mnot be mounted at all as it has open files early on

You do it early in the boot. I found the issue. The "make /var persistent" option in the configuration was not set. My bad.

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