Skip to content

fix: forward startup messages to logWriter - #643

Merged
AkihiroSuda merged 1 commit into
rootless-containers:masterfrom
haytok:forward-startup-messages
Sep 24, 2026
Merged

AkihiroSuda merged 1 commit into
rootless-containers:masterfrom
haytok:forward-startup-messages

Conversation

@haytok

@haytok haytok commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Currently, the startup messages printed by pasta are discarded, because logWriter is passed to pasta.NewParentDriver but never used.

This commit forwards them to logWriter so that they appear in the debug log, like the slirp4netns driver does.

After applying this commit, the following log is shown with --debug:

DEBU[0000] [rootlesskit:parent] network/pasta: UNIX domain socket bound at /tmp/haytok/.pasta.sock
DEBU[0000] [rootlesskit:parent] network/pasta: Configuration socket: /tmp/haytok/.pasta.sock
DEBU[0000] [rootlesskit:parent] network/pasta: Template interface: dummy42 (IPv4), dummy42 (IPv6)
DEBU[0000] [rootlesskit:parent] network/pasta: Namespace interface: tap0
DEBU[0000] [rootlesskit:parent] network/pasta: MAC:
DEBU[0000] [rootlesskit:parent] network/pasta:     host: 9a:55:9a:55:9a:55
DEBU[0000] [rootlesskit:parent] network/pasta: DHCP:
DEBU[0000] [rootlesskit:parent] network/pasta:     assign: 10.0.2.100
DEBU[0000] [rootlesskit:parent] network/pasta:     mask: 255.255.255.0
DEBU[0000] [rootlesskit:parent] network/pasta:     router: 10.0.2.2
DEBU[0000] [rootlesskit:parent] network/pasta: DNS:
DEBU[0000] [rootlesskit:parent] network/pasta:     10.0.2.3
DEBU[0000] [rootlesskit:parent] network/pasta: DNS search list:
DEBU[0000] [rootlesskit:parent] network/pasta:     .
DEBU[0000] [rootlesskit:parent] network/pasta: NDP/DHCPv6:
DEBU[0000] [rootlesskit:parent] network/pasta:     assign: fd00::100
DEBU[0000] [rootlesskit:parent] network/pasta:     router: fd00::2
DEBU[0000] [rootlesskit:parent] network/pasta:     our link-local: fe80::9cca:6ff:fe87:1ae1
DEBU[0000] [rootlesskit:parent] network/pasta: DNS search list:
DEBU[0000] [rootlesskit:parent] network/pasta:     .
DEBU[0000] [rootlesskit:parent] network/pasta: Inbound forwarding rules (HOST):
DEBU[0000] [rootlesskit:parent] network/pasta: Outbound forwarding rules (SPLICE):

Currently, the startup messages printed by pasta are discarded, because
`logWriter` is passed to `pasta.NewParentDriver` but never used.

This commit forwards them to `logWriter` so that they appear in the debug
log, like the slirp4netns driver does.

After applying this commit, the following log is shown with `--debug`:

```bash
DEBU[0000] [rootlesskit:parent] network/pasta: UNIX domain socket bound at /tmp/haytok/.pasta.sock
DEBU[0000] [rootlesskit:parent] network/pasta: Configuration socket: /tmp/haytok/.pasta.sock
DEBU[0000] [rootlesskit:parent] network/pasta: Template interface: dummy42 (IPv4), dummy42 (IPv6)
DEBU[0000] [rootlesskit:parent] network/pasta: Namespace interface: tap0
DEBU[0000] [rootlesskit:parent] network/pasta: MAC:
DEBU[0000] [rootlesskit:parent] network/pasta:     host: 9a:55:9a:55:9a:55
DEBU[0000] [rootlesskit:parent] network/pasta: DHCP:
DEBU[0000] [rootlesskit:parent] network/pasta:     assign: 10.0.2.100
DEBU[0000] [rootlesskit:parent] network/pasta:     mask: 255.255.255.0
DEBU[0000] [rootlesskit:parent] network/pasta:     router: 10.0.2.2
DEBU[0000] [rootlesskit:parent] network/pasta: DNS:
DEBU[0000] [rootlesskit:parent] network/pasta:     10.0.2.3
DEBU[0000] [rootlesskit:parent] network/pasta: DNS search list:
DEBU[0000] [rootlesskit:parent] network/pasta:     .
DEBU[0000] [rootlesskit:parent] network/pasta: NDP/DHCPv6:
DEBU[0000] [rootlesskit:parent] network/pasta:     assign: fd00::100
DEBU[0000] [rootlesskit:parent] network/pasta:     router: fd00::2
DEBU[0000] [rootlesskit:parent] network/pasta:     our link-local: fe80::9cca:6ff:fe87:1ae1
DEBU[0000] [rootlesskit:parent] network/pasta: DNS search list:
DEBU[0000] [rootlesskit:parent] network/pasta:     .
DEBU[0000] [rootlesskit:parent] network/pasta: Inbound forwarding rules (HOST):
DEBU[0000] [rootlesskit:parent] network/pasta: Outbound forwarding rules (SPLICE):
```

Signed-off-by: Hayato Kiwata <dev@haytok.jp>
@AkihiroSuda AkihiroSuda added this to the v3.2.1 milestone Sep 24, 2026

@AkihiroSuda AkihiroSuda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda
AkihiroSuda merged commit d551a2c into rootless-containers:master Sep 24, 2026
10 checks passed
@haytok
haytok deleted the forward-startup-messages branch September 24, 2026 09:21
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.

2 participants