You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Send a HUP, TERM, or KILL signal to a job running in ContainerPilot without having to subscribe to the SIGHUP and SIGUSR2 handlers that CP is running.
I discovered the need for this functionality while dealing with applications that don't support PID Files or a simple way of discovering the pid.
In this particular case ( elastic/logstash#3577 (comment) ) the maintainers refuse to implement the functionality, and have decided this is the job of the init system.
Proposed Solution:
Add "-termjob 'jobname'", "-killjob 'jobname'", and "-reloadjob 'jobname'" to the ContainerPilot control plane.
Behavior:
-termjob, will send the TERM signal to the provided jobname.
-killjob, will send the KILL signal to the provided jobname.
-reloadjob will send the HUP signal to the provided jobname.
Useful example:
In the autopilot pattern we run into situations where we need to change a job's configuration, and then send the appropriate signal to the corresponding jobs.
kill and term should only apply to jobs where restarts are allowed.
Confession:
#513 Can accommodate most of this, but I can envision a circumstance where this pattern might be more convenient and easier for people to use, and reason about. I didn't see 513, until I wrote the first bit of code.
Possible negative impacts:
I can't really find any possible future issues with having this feature in the Control Plane if implemented correctly. The current Signal handler should co-exist without issue.
The text was updated successfully, but these errors were encountered:
Problem:
Send a HUP, TERM, or KILL signal to a job running in ContainerPilot without having to subscribe to the SIGHUP and SIGUSR2 handlers that CP is running.
I discovered the need for this functionality while dealing with applications that don't support PID Files or a simple way of discovering the pid.
In this particular case ( elastic/logstash#3577 (comment) ) the maintainers refuse to implement the functionality, and have decided this is the job of the init system.
Proposed Solution:
Add "-termjob 'jobname'", "-killjob 'jobname'", and "-reloadjob 'jobname'" to the ContainerPilot control plane.
Behavior:
-termjob, will send the TERM signal to the provided jobname.
-killjob, will send the KILL signal to the provided jobname.
-reloadjob will send the HUP signal to the provided jobname.
Useful example:
In the autopilot pattern we run into situations where we need to change a job's configuration, and then send the appropriate signal to the corresponding jobs.
or if logstash can't reload our change with a HUP, restart it with a TERM.
or if we really really want to be brave, we can KILL it quickly.
kill and term should only apply to jobs where restarts are allowed.
Confession:
#513 Can accommodate most of this, but I can envision a circumstance where this pattern might be more convenient and easier for people to use, and reason about. I didn't see 513, until I wrote the first bit of code.
Possible negative impacts:
I can't really find any possible future issues with having this feature in the Control Plane if implemented correctly. The current Signal handler should co-exist without issue.
The text was updated successfully, but these errors were encountered: