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


Directory structure: <project path>/supervise/run <project path>/supervise/log/run <project path>/supervise/log/main/current

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.
  • You could hack a FIFO and a tee in there. Or you could provide details of how you run supervise, e.g. give a directory structure you use. (daemontools are not very popular among *nix users, 'cause of crazy licencing) – grochmal Aug 26 '16 at 3:28
  • Thanks @grochmal, I didn't realize that about the licensing. I'm not married to supervise. The main reason I went with it is it allowed me to keep my scripts within my application and not have to distribute them throughout the file system. Is there an alternative that still allows this? – Brad Aug 26 '16 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.