Ubus: not creating needed /var/run directory

/sbin/init create /tmp/run directory.
ubus uses /var/run directory that's normally linked to /tmp aka /tmp/run and starts up.
If by accident /var is deleted and the router is rebooted the system hangs forever.
It does not help to create an empty /var directory /var/run is not created by ubus.
Console shows: "procd - early -" and afterwards "procd - ubus -"
The needed directories are created later inside "/etc/rc.d/S10boot" aka "/etc/init.d/boot"
Same in 17.01.x

Please direct bug reports to bugs.openwrt.org, they'll get lost here.

bug report created

Thank you :slight_smile:

Hi,
I have the same issue because I don't want to have /var linked to /tmp.
I don't see the bug report opened... Do you have any update on this issue?
Thanks

My steps I do when unlinking:
Instead using /run you can use /var/run and /var/lock directly.
!!! /var must be on "permanent" disk space !!!

rm /var
mkdir -m 0755 -p /var
mkdir -m 0775 -p /var/log
mkdir -m 0755 -p /var/state
mkdir -m 1777 -p /var/tmp
mkdir -m 0755 -p /run
mkdir -m 1777 -p /run/lock
ln -fs /run /var/run
ln -fs /run/lock /var/lock
sync
sleep 1
reboot

@chris5560 what would be your approach to have /var on permanent storage (is it usb, or sata as in my case of gnubee hw running openwrt).

which "injection" point would you use? I did some searching, (including discovering undocumented 'block extroot' call) but stopped (with problems) on /etc/init.d/boot modifications.

block mount (using /etc/config/fstab) has two problems:

  1. it is too late in boot process
  2. some important files are already present there (e.g./var/run/ubus.sock)

I'm looking for a general solution to have permanent /var filesystem.