Skip to content

timeout: subprocess is never terminated #4176

@miles170

Description

@miles170

When I was working on #4073, I discovered that timeout never terminates the subprocess under the sh shell.
Is this expected behavior?

$ timeout .5 sh -c "yes | split --filter='head -c1 >/dev/null' -b 1000"
$ ps aux | grep split
coreuti+ 55384  0.0  0.0   3244   712 pts/0    S+   05:05   0:00 grep split
$ /coreutils/target/release/timeout .5 sh -c "yes | split --filter='head -c1 >/dev/null' -b 1000"
$ ps aux | grep split
coreuti+ 55388  6.0  0.0   2680  1672 pts/0    S    05:05   0:00 split --filter=head -c1 >/dev/null -b 1000
coreuti+ 61201  0.0  0.0   3244   644 pts/0    S+   05:05   0:00 grep split

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions