Closed small-5 closed 3 months ago
Have you experienced errors with the use of "/run"? Can you link to an OpenWRT policy document that says not to use it?
I see that "/run" is a symlink to "/var/run", and thus it has no problem with staying unpatched. This would be the only OpenWRT-specific patch in the source code, so it should be avoided if at all possible. If not possible to avoid, we are the upstream, so we also should avoid carrying a patch file and just have an ifdef in the actual source code (as that is more resilient to changes)
Yes, an error will be reported if /run is used. OpenWrt does not have a /run directory, only /var/run (actually /tmp/run) If don't use a patch, can only add a flag to determine whether it is OpenWrt.
My openwrt systems all have a "/run" as a symlink to "/var/run", so I dont see any problem. Have openwrt changed they way they work recently? Can you link to this change?
The OpenWrt code does not symlink "/run" to "/var/run", only $(LN) /tmp/run $(1)/var/run
https://github.com/openwrt/openwrt/blob/e6fec638d2791547c45c9a5267be07a722e03cd9/package/base-files/files/etc/init.d/boot#L27 https://github.com/openwrt/openwrt/blob/e6fec638d2791547c45c9a5267be07a722e03cd9/package/base-files/Makefile#L223
In my impression, OpenWrt projects all use /var/run or /tmp/run
Equally, I can show you an openwrt system that has a symlink from /run to /var/run - which now appears to be a vendor patch.
Probably a better patch would be to plumb up the (currently unused) configure --runstatedir option to default to "/run" (as all modern linux systems use and expect) and allow the openwrt build to specify a --runstatedir=/var/run
Your OpenWrt should used a third-party patch, so there is a /run directory. For me, using configure --runstatedir or patch can achieve the same effect.
Managing a patch file is more unreliable, harder to edit and more hidden from view. Their use is valuable when the upstream cannot fix or change things. Since this is the upstream project, we can fix the problem at the source by adding a configure feature
Then let me modify the code and add runstatedir to test it.
Just so you know, you can just reuse the same pull request, and push different patches into it - which has the advantage that the context, old patch history and conversation is not lost
OpenWrt should use /var/run/n3n instead of /run/n3n. The libcap is not required.