Skip to content

Shut down all children on SIGTERM #39

Closed

Description

@etianen

I see that parallelshell responds to the SIGINT signal by cleanly shutting down all it's children.

However, when stopped with the SIGTERM signal it simply exits, leaving all it's spawned children running.

Is this intentional behaviour?

Activity

  1. keithamus commented on Oct 19, 2015

    @keithamus
    Collaborator

    Hey @etianen thanks for the issue. It sounds like a bug. PRs welcome to fix it 😉

  2. etianen commented on Oct 19, 2015

    @etianen
    Author

    Out of interest, why does parellelshell choose to terminate child processes
    with SIGINT rather than SIGTERM?

    I think the correct behaviour here is to listen for both SIGINT and
    SIGTERM, then stop the child processes with the same signal. I'm not
    totally certain, however. I think you could also make a case for
    responding to both SIGINT and SIGTERM, but always sending SIGTERM to child
    processes (it's the traditional kill signal).

    On Mon, 19 Oct 2015 at 09:54 Keith Cirkel [email protected] wrote:

    Hey @etianen https://github.com/etianen thanks for the issue. It sounds
    like a bug. PRs welcome to fix it [image: 😉]

    —
    Reply to this email directly or view it on GitHub
    #39 (comment)
    .

  3. keithamus commented on Oct 19, 2015

    @keithamus
    Collaborator

    SIGINT is used when a terminal sends Ctrl+C. We close apps down because that's what you'd expect from sending Ctrl+C. I guess we should probably send all signals to the respective processes though, as you suggest.

    FYI, if you submit a PR to this code, you should know that mysticatea/npm-run-all#10 exists and that parallelshell may be deprecated soon, in favour of consolidating it with other libs (see mysticatea/npm-run-all#10 for more). While I'm happy to release new versions in the interim - this is the end goal of parallelshell (to be subsumed/consumed into npm-run-all).

  4. etianen commented on Oct 19, 2015

    @etianen
    Author

    Hmm, I see, thanks for the heads up!

    I'm not sure I'll bother with the PR, in that case. I've been using
    parallelshell as a quick process manager hack, but I can make do with bash
    builtins in the meanwhile. :)

    On Mon, 19 Oct 2015 at 10:11 Keith Cirkel [email protected] wrote:

    SIGINT is used when a terminal sends Ctrl+C. We close apps down because
    that's what you'd expect from sending Ctrl+C. I guess we should probably
    send all signals to the respective processes though, as you suggest.

    FYI, if you submit a PR to this code, you should know that
    mysticatea/npm-run-all#10
    mysticatea/npm-run-all#10 exists and that
    parallelshell may be deprecated soon, in favour of consolidating it with
    other libs (see mysticatea/npm-run-all#10
    mysticatea/npm-run-all#10 for more). While
    I'm happy to release new versions in the interim - this is the end goal of
    parallelshell (to be subsumed/consumed into npm-run-all).

    —
    Reply to this email directly or view it on GitHub
    #39 (comment)
    .

  5. self-assigned this
    on Oct 18, 2017
  6. darkguy2008 commented on Sep 27, 2026

    @darkguy2008
    Owner

    Hey! This is in 3.0.3. parallelshell now forwards SIGINT, SIGTERM and SIGHUP to every command and then exits by the same signal. Feel free to reopen if something's still off. Thanks!

  7. etianen commented on Sep 27, 2026

    @etianen
    Author

    Thanks! It's been, um... 11 years, so I don't even remember raising this issue! 😝

    Good to see the project is maintained, though! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions