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

SystemD Service #3645

Closed
Trozz opened this issue Aug 11, 2016 · 4 comments
Closed

SystemD Service #3645

Trozz opened this issue Aug 11, 2016 · 4 comments

Comments

@Trozz
Copy link

Trozz commented Aug 11, 2016

Not an issue, I want to know if people want this committed to the repo, it does not stop the process correctly however it does work.

I use the run script as I have updated the script to include a git pull to ensure that I am using the latest of the dev branch.

run.sh

[Unit]
Description=Pokemon Bot
After=network.target

[Service]
Type=Forking
WorkingDirectory=%PATH-TO-PokemonGo-Bot%
ExecStart=/bin/bash ./run.sh
Restart=on-abort

[Install]
WantedBy=multi-user.target

Python

[Unit]
Description=Pokemon Bot
After=network.target

[Service]
Type=Forking
WorkingDirectory=%PATH-TO-PokemonGo-Bot%
ExecStart=/usr/bin/python pokecli.py -cf ./configs/config.json
Restart=on-abort

[Install]
WantedBy=multi-user.target
@k4n30
Copy link
Contributor

k4n30 commented Aug 11, 2016

It's been awhile since I tinkered with systemd but isn't there an option to kill processes on crash? Either that or on start/restart kill any python processes (dirty but does the job). Either way I would create a pull request and have your enhancement added and any niggling issues dealt with there

Edit: You could also store the pid and use that to kill the process if needed

@k4n30
Copy link
Contributor

k4n30 commented Aug 23, 2016

@Trozz Are you still keen to create a PR for this?

@mjmadsen
Copy link
Contributor

@Trozz @k4n30 We kind of have this (at least a notice). Can we close?

@k4n30
Copy link
Contributor

k4n30 commented Aug 29, 2016

@mjmadsen This isn't really implemented, but I think there are sufficient scripts to probably achieve what it's functionally trying to achieve. Happy to close as OP hasn't responded

@k4n30 k4n30 closed this as completed Aug 29, 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

3 participants