-
Notifications
You must be signed in to change notification settings - Fork 521
Open
Description
It would be useful to have an option to configure tini to terminate/kill reaped child processes. Similar to what dinit or anakin try to do.
An example use case would be to use tini with supervisord to spawn multiple processes which spawn children. At the moment if the process spawned by supervisord dies then its children are reparented to tini and live forever.
A curated example:
$ ps axf -eo pid,command
PID COMMAND
1 /usr/bin/tini -- /as_drive/entrypoint.sh bash
11 bash
76 \_ /usr/bin/python3 /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
90 \_ /usr/bin/python3 /opt/ros/humble/bin/ros2 launch foo bar.launch.py --
109 \_ /opt/ros/humble/lib/rclcpp_components/component_container --ros-args -r __node:=foo -r __ns:=/
$ kill -9 90
$ # Supervised process is killed. Its child is reparented to tini. Supervisord recreates killed process with a new child.
$ ps axf -eo pid,command
PID COMMAND
1 /usr/bin/tini -- /as_drive/entrypoint.sh bash
11 bash
76 \_ /usr/bin/python3 /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
166 \_ /usr/bin/python3 /opt/ros/humble/bin/ros2 launch foo bar.launch.py --
179 \_ /opt/ros/humble/lib/rclcpp_components/component_container --ros-args -r __node:=foo -r __ns:=/
109 /opt/ros/humble/lib/rclcpp_components/component_container --ros-args -r __node:=foo -r __ns:=/
$ # There is a duplicated child process.
yosifkit
Metadata
Metadata
Assignees
Labels
No labels