Skip to content

mtail: explicitly read from /dev/stdin#812

Open
feld wants to merge 1 commit intomainfrom
mtail
Open

mtail: explicitly read from /dev/stdin#812
feld wants to merge 1 commit intomainfrom
mtail

Conversation

@feld
Copy link
Collaborator

@feld feld commented Jan 19, 2026

I wish I could understand why this was happening, but even though my deployment with my Chatmail cookbook produced a 100% identical ExecStart command, the mtail process was trying to read a file named /- which did not exist.

This is a harmless change and should ensure nobody else runs into this mysterious edge case.

@feld feld temporarily deployed to staging-ipv4.testrun.org January 19, 2026 19:37 — with GitHub Actions Inactive
@feld feld temporarily deployed to staging2.testrun.org January 19, 2026 19:37 — with GitHub Actions Inactive
@missytake
Copy link
Contributor

Can you rebase this on top of #813 so CI can test this PR?

The shell alias "-" should work for stdin, but on one of my servers it
was not working and stracing the process showed it kept trying to open a
file named /-. I do not know how or why this was the case, but altering
it to read /dev/stdin instead solved the issue.
@feld feld temporarily deployed to staging2.testrun.org January 21, 2026 20:25 — with GitHub Actions Inactive
@feld feld temporarily deployed to staging-ipv4.testrun.org January 21, 2026 20:25 — with GitHub Actions Inactive
Copy link
Contributor

@missytake missytake left a comment

Choose a reason for hiding this comment

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

Looks good in a smoke test :)

@link2xt
Copy link
Contributor

link2xt commented Jan 22, 2026

It could be you have old mtail version that does not support -. Changing to /dev/stdin then will not fix it, it will just get stuck after some time. See #581 and #579

@feld
Copy link
Collaborator Author

feld commented Feb 3, 2026

It could be you have old mtail version that does not support -.

that doesn't make sense to me, "-" is a shell feature not something that mtail would need to natively support, right?

edit: huh! It's not a shell feature? TIL after all these years...

anyway, I'm not using an old mtail version I'm installing 3.0.9 which is the latest. It's not getting stuck for me, seems to be working great now with /dev/stdin

@link2xt
Copy link
Contributor

link2xt commented Feb 3, 2026

I think new version is not getting stuck since about the same time as they added -. Likely added -, tried it, realized it's broken, then fixed. So using - instead of /dev/stdin ensures that the version is at least somewhat new.

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.

3 participants