Skip to content

fix(linux): pass the application command to urunit in config - #1136

Open
indrajithek wants to merge 6 commits into
urunc-dev:mainfrom
indrajithek:fix/linux-args-urunit-config
Open

indrajithek wants to merge 6 commits into
urunc-dev:mainfrom
indrajithek:fix/linux-args-urunit-config

Conversation

@indrajithek

@indrajithek indrajithek commented Oct 20, 2026 •

Copy link
Copy Markdown

Description

Linux guests that use urunit as init, urunc passes the application's arguments on the kernel command line. The kernel can't carry an arbitrary argument list, so some arguments get dropped or cut (described in #1067).

This writes the application command into the urunit config as ARC/ARV entries, the same way FreeBSD guests already do. urunit takes the command from the config when it is started without arguments.

Plus, argument with newline is handled with clear error message (since the config is line based). Edit on 6th Nov: However I removed my solution to this from the PR given there was another PR addressing this part of the issue better than mine ( #1068 ).

Note: Given ARC/ARV support came out recent, image with an older urunit fails to start with No application execute. I checked the /urunit binary in the Linux e2e images: the 8 *-linux-raw ones don't have it (I've not check the initrd and block ones), so they would need a rebuild from urunit:latest. The v0.1.0 download links in the tutorial have the same problem.

Related issues

How was this tested?

All the cases reported in #1067 are tested via unit tests linux_test.go

LLM usage

Only claude Code Opus 5.5 with XHigh effort is used (manual mode). Decision making or architecture is not by AI. If code generation was used, it's reviewed manually line by line.

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl). Before running this all linux images need to rebuild with latest urunit with ARC/ARV
  • If LLMs were used: I have read the llm policy.

@netlify

netlify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

👷 Deploy request for urunc pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 39412ed

@indrajithek
indrajithek force-pushed the fix/linux-args-urunit-config branch 2 times, most recently from fba940e to 96b1459 Compare October 24, 2026 07:27
The Linux kernel command line cannot carry an arbitrary argument list:
an empty argument disappears, a literal `--` cuts off the rest, the
list is truncated at 2048 bytes and more than 32 arguments panic the
kernel.

When urunit is the init, write the application command in the urunit
configuration as `ARC`/`ARV` entries, as FreeBSD guests already do, and
stop passing it on the kernel command line. Also return a clear error
when an argument contains a newline.

This fix requires a urunit that reads `ARC`/`ARV`.

Fixes: urunc-dev#1067
Signed-off-by: Indrajith <29561593+indrajithek@users.noreply.github.com>
Signed-off-by: Indrajith <29561593+indrajithek@users.noreply.github.com>
Add the `ARC`/`ARV` entries to the documented urunit configuration
format and update the list of actions urunit performs.

Ref: urunc-dev#1067
Signed-off-by: Indrajith <29561593+indrajithek@users.noreply.github.com>
@indrajithek
indrajithek force-pushed the fix/linux-args-urunit-config branch from 96b1459 to 6dd22f1 Compare November 6, 2026 14:31
Noticed urunc-dev#1068 is also addressing arguments containing a newline.
Removing it from this PR to avoid conflicts.

Signed-off-by: Indrajith <29561593+indrajithek@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Passing app arguments on the kernel command line quietly mangles some of them

1 participant