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

Long running processes #31

Open
pitosalas opened this issue Feb 9, 2020 · 5 comments
Open

Long running processes #31

pitosalas opened this issue Feb 9, 2020 · 5 comments

Comments

@pitosalas
Copy link

What's the right way to launch a process that is meant to keep on running? For example, my ruby program is a service that listens on a tcpip port until it is killed. If I start it with a simple command then the runbook blocks. If ^c the runbook then I think the service is left in limbo. This can't be right can it?

p.s. is there a gitter or slack channel on which I can more reasonably post these questions? I know you said it's ok but ...

@pblesi
Copy link
Contributor

pblesi commented Feb 11, 2020

I'm happy to inform you that you've inspired me to set up a gitter chatroom: https://gitter.im/braintree/runbook?utm_source=share-link&utm_medium=link&utm_campaign=share-link

Is the intent to have the process run in parallel during the life of the runbook or to have the runbook start the process so it executes indefinitely? In the former case, using tmux_command is the preferred way to execute processes in parallel with the execution of the runbook. In the latter case, I would recommend using some sort of process manager to ensure your process continues to run and then to interact with your process manager to start or stop the process.

@pitosalas
Copy link
Author

See followup in Gitter!

@pitosalas
Copy link
Author

Reopening this question. I've set up systemctl to start up my service only to realize that my service needs to be given various tokens to run and that my go-to way of doing that was with environment variables... why in turn are not set up (obviously) when I start it with systemctl. So it seems like starting it via ssh / runback still might be a good idea. But now I am back to the question of a "long running process". Do you still recommend that I use something like systemctl and somehow give it that correct values for the environment variables?

@pitosalas pitosalas reopened this Feb 20, 2020
@pblesi
Copy link
Contributor

pblesi commented Feb 21, 2020

Yeah, I think systemctl is still the way to go. I would recommend creating configuration files in /etc/your_app. These files can contain your tokens, and you can upload the files using Runbook. Your long running process would read that file when it starts up.

@coopergillan
Copy link
Contributor

@pitosalas - were you able to try @pblesi's suggestion here?

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

No branches or pull requests

3 participants