Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve process handling #427

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Improve process handling #427

wants to merge 4 commits into from

Conversation

bt90
Copy link

@bt90 bt90 commented Jan 12, 2023

The scrutiny container currently spawns multiple superfluous bash processes.

docker top scrutiny acxf yields:

PID                 TTY                 STAT                TIME                COMMAND
3265068             ?                   Ss                  0:00                \_ s6-svscan
3265188             ?                   S                   0:00                | \_ s6-supervise
3265397             ?                   S                   0:00                | \_ s6-supervise
3265402             ?                   Ss                  0:00                | | \_ bash
3265412             ?                   S                   0:00                | | \_ cron
3265398             ?                   S                   0:00                | \_ s6-supervise
3265406             ?                   Ss                  0:00                | | \_ bash
3265427             ?                   Sl                  1:10                | | \_ influxd
3265399             ?                   S                   0:00                | \_ s6-supervise
3265400             ?                   S                   0:00                | \_ s6-supervise
3265403             ?                   Ss                  0:00                | \_ bash
3265575             ?                   Sl                  0:03                | \_ scrutiny
3265821             pts/0               Ss+                 0:00                \_ sh

This PR switches the shell scripts to run their main process with exec effectively replacing the shells process.

@AnalogJ
Copy link
Owner

AnalogJ commented Jan 13, 2023

Interesting idea. Can you describe the use-case a bit? Is the intention to make monitoring cron within the container easier to do? Or is there some other reason you run docker top scrutiny acxf?

@bt90
Copy link
Author

bt90 commented Jan 13, 2023

This is mostly about correct signal handling and a tiny bit to satisfy my OCD.

A bash proces - at least without traps - won't propagate signals to its child processes.

https://docs.docker.com/compose/faq/#why-do-my-services-take-10-seconds-to-recreate-or-stop

@AnalogJ
Copy link
Owner

AnalogJ commented Jan 16, 2023

seems reasonable. I'd appreciate if you confirm that the hub/spoke and omnibus images all work correctly after your changes, especially the cron and collector images.

@AnalogJ
Copy link
Owner

AnalogJ commented Feb 4, 2023

hey @bt90 have you had a chance to do any verification? I'd love to merge this PR

@bt90
Copy link
Author

bt90 commented Feb 4, 2023

Sadly not yet. Not too much freetime ATM :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants