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

Daemonize the bot and make a debug mode. #29

Closed
rawsonj opened this issue Aug 16, 2013 · 5 comments
Closed

Daemonize the bot and make a debug mode. #29

rawsonj opened this issue Aug 16, 2013 · 5 comments

Comments

@rawsonj
Copy link
Owner

rawsonj commented Aug 16, 2013

I'm tired of running it in a screen. We don't have to stay attached to the thing while its running, and it makes sense to daemonise it unless we pass it a --debug, where it will not daemonise and will interact with whoever is attached to it.

@rawsonj
Copy link
Owner Author

rawsonj commented Aug 31, 2016

http://web.archive.org/web/20131017130434/http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

Shows a python daemon implementation.

Alternatively, we could just write a bash wrapper that does the needful, but I'm less inclined to do that than something in python I think.

@andy5995
Copy link
Contributor

I'd say that if it can be done in python, then there's no real reason to have a separate BASH script.

With one exception: my initial thoughts are that a BASH script could still be included to give the user the option to integrate it into their init scripts. But the primary daemonization would be coded into the .py file.

And for the record, I'm much better with BASH than python, atm. ;) That's something I'd be able to work on.

@rawsonj
Copy link
Owner Author

rawsonj commented Sep 1, 2016

I'm just weighing the relative complexity of incorporating the above linked daemon code vs. just writing a bash wrapper that goes nohup python trivia.py &

The latter is a lot less code and very easy to maintain. The former... well I'm not sure yet. I think it depends on how much time either of us want to put into it.

@andy5995
Copy link
Contributor

andy5995 commented Sep 1, 2016

I'm leaning toward option 1.

If there's some reason more complex needs to be added in the future, or until users start giving us reason why a native daemon method would be better, I think the bash wrapper is the way to go.

@rawsonj
Copy link
Owner Author

rawsonj commented Sep 2, 2016

Ok. I'll add something.

rawsonj pushed a commit that referenced this issue Sep 2, 2016
feat: Add a simple bot starting wrapper. Addresses #29.
@rawsonj rawsonj closed this as completed Sep 2, 2016
@andy5995 andy5995 added Fixed and removed help wanted labels Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants