#1103242 /bin/ip: "ip mon" does not exit when output is gone

Package:
iproute2
Source:
iproute2
Description:
networking and traffic control tools
Submitter:
Simon Richter
Date:
2025-04-16 10:36:02 UTC
Severity:
normal
Tags:
#1103242#5
Date:
2025-04-15 11:18:56 UTC
From:
To:
Hi,

I started "ip mon" in the background, and closed the shell and the terminal.

The "ip" command is still running, receiving netlink messages and writing to
stdout, receiving EIO for this attempt.

Monitor mode should probably exit when it cannot write output.

   Simon

#1103242#10
Date:
2025-04-15 14:35:21 UTC
From:
To:
Control: tags -1 moreinfo

Hi,

Isn't this normal behaviour? IE, if I do 'sleep infinity &' and close
the terminal, it will likewise hang around

#1103242#17
Date:
2025-04-15 14:35:21 UTC
From:
To:
Control: tags -1 moreinfo

Hi,

Isn't this normal behaviour? IE, if I do 'sleep infinity &' and close
the terminal, it will likewise hang around

#1103242#22
Date:
2025-04-15 22:57:10 UTC
From:
To:
Hi,

Yes, but "sleep" will eventually exit, and doesn't produce output, so it
doesn't have an opportunity to notice that stdout has been revoked.

And since the only function in monitor mode is to produce this output,
it can just exit here.

    Simon

#1103242#29
Date:
2025-04-16 10:34:12 UTC
From:
To:
stdout, receiving EIO for this attempt.

I see - then this is more like a feature request than a
packaging/downstream regression/issue.

Stephen, David, what do you think about the above request?