I have a process that runs via supervise. I am logging the output via log/run which is using multilog so the log output ends up in log/main/current. I also want to pipe the output into a second command that happens to be 'aws logs push' which pushes the log to AWS CloudWatch Logs after buffering.
How do I setup my log/run script so that it logs immediately through multilog and also pipes into 'aws logs push' to eventually be available in AWS CloudWatch Logs?
My log/run script is:
exec setuidgid <username> multilog ./main
Now that I've slept I think my confusion can be summed up as follows:
- The recommendation when using supervise is to 'exec' the process within your run script so that it will receive the signals sent to it by supervise.
- I'd need to catch and send all signals sent to the supervise log process and send to 2 processes to ensure they both shut down correctly.
- I'm not clear how to make 2 processes read from stdin within a script concurrently.