Skip to content

Scripts are not properly terminated #23

@fbecart

Description

@fbecart

Zinoma does not properly kill child processes.

  • These processes can keep running after Zinoma shut down.
  • These processes can stack up in watch mode.

This issue can be circumvented by adding exec in front of the problematic commands. For instance:

targets:
  my_target:
    service: exec ping github.com

It seems like the proper solution would be to start a new process group in the child process (using setpgid()) before running the script.
Then, the process group could be killed with kill(-pid).

This was successfully implemented by watchexec: https://github.com/watchexec/watchexec/blob/5843deb5732f1e92ad7b6775f52de7c8be063f6c/src/process.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions