Skip to content

feat: enable persistent var (EXPERIMENTAL)#1680

Draft
gsanchietti wants to merge 65 commits into
nethsecurity-8.8from
persistent_var
Draft

feat: enable persistent var (EXPERIMENTAL)#1680
gsanchietti wants to merge 65 commits into
nethsecurity-8.8from
persistent_var

Conversation

@gsanchietti
Copy link
Copy Markdown
Member

@gsanchietti gsanchietti commented May 15, 2026

EXPERIMENTAL: test how the image behaves

Upstream commit: openwrt/openwrt@57807f5

@gsanchietti gsanchietti self-assigned this May 15, 2026
@Tbaile Tbaile force-pushed the nethsecurity-8.8 branch 2 times, most recently from 4001fc2 to 841b872 Compare May 20, 2026 07:12
@gsanchietti gsanchietti mentioned this pull request May 20, 2026
39 tasks
Tbaile and others added 23 commits May 20, 2026 11:05
Sync the local adblock fork to upstream 4.5.5-3 while keeping the
NethSecurity-specific ts-dns hooks, bypass migration, and nft bypass
rules intact.

Assisted-by: Copilot:gpt-5.4
Changes:
- add a new `nft-reload` action inside adbblock.sh
- trigger reload when the configuration has been updated
- call nft-reload on reload

The above changes will recreated the nft chain
when the bypass configuration has been changed.
Store Threat Shield DNS local allow and block list edits in UCI
so rapid API calls no longer rewrite adblock files or restart the
service immediately.

Write the physical adblock list files during the next reload, add a
one-shot migration for existing list files, and document the staged
workflow for the affected API methods.

Refs #1572
Assisted-by: Copilot:gpt-5.4
The init file from upstream replaces the dpd_action option values.
Notably it replaces `restart` with `start`, but `start` value
is not supported by Strongswan 6.
Make sure if `restart` is set, the value is preserved.

From the manual:

  Action to perform for this CHILD_SA on DPD timeout. The default clear closes the CHILD_SA
  and does not take further action. trap installs a trap policy, which will catch matching traffic
  and tries to re-negotiate the tunnel on-demand (note that this is redundant if start_action includes trap.
  restart immediately tries to re-negotiate the CHILD_SA under a fresh IKE_SA.
…lity

Implement two key improvements to package restoration after system upgrades:

1. Resilient retry mechanism: Script now tracks installation failures and
   exits with code 1 when packages fail to install. The procd respawn policy
   (respawn 300 30 10) will automatically retry on the next boot, accounting
   for WAN initialization delays and transient network failures.

2. Reliable output reporting: Only report "Restored package: X" when the
   package installation actually succeeds (apk exit code 0). Failed
   installations are reported separately, and the service is not disabled
   until all packages are successfully restored. This relies on apk's
   reliable exit codes instead of opkg's unreliable behavior.

The service now remains enabled after failures, allowing the procd respawn
mechanism to retry on subsequent boots until all packages are restored.

Closes #1606
Assisted-by: Copilot:claude-haiku-4.5
EXPERIMENTAL: test how the image behaves
@gsanchietti
Copy link
Copy Markdown
Member Author

The persistent var could be useful to retain the following files:

  • /var/log/lastlog is always empty
  • /var/log/messages is already stored also in /mnt/data
  • /var/log/wtmp could be useful, but we do not have the last command to parse it, also similar info is already present inside the messages

But has many drawbacks:

  • upstream implementation does not support mounting a different partition under /var
  • it stores also many files in /vat/etc that are recreated by applications upon starts, such files should be temporary
  • the messages file can get bigger and fill all the root
  • victoria metrics are stored inside /var/lib/victoria-metrics-data and can get bigger and fill the root
  • despite of the linked commit, having a persistent var does not preserve dhcp leases across reboots because they are saved by default on a temp directory (dhcp.ns_dnsmasq.leasefile='/tmp/dhcp.leases')

In the end, I think that persistent may cause many problems on long running machines.
My opinion is to ditch the feature and eventually move the DHCP lease to storage, when present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants