[SOLVED] Intermediate Python : `signal` Module
Some of you may already be familiar with Mod-Bot. If you are not - allow me to explain a couple of things, so that this question may be a bit easier to understand. Mod-Bot is a program that listens for bot-commands to be entered by users on Discord. It is hosted by a web-service called Heroku (a server that keeps it alive & operational 24/7). Mod-Bot's source-code is stored on GitHub. I have Heroku & GitHub linked in such a way, that whenever I push changes/updates to the GitHub repository - the Heroku app (Mod-Bot) is automatically redeployed/rebooted. I am only aware of two ways to reboot the bot: a) to push changes to the GitHub repository, and b) to navigate to Heroku directly and redeploying it manually (what the Mod-Bot Admins do whenever the bot gets fussy). However, while reading the app's logs, I've noticed a few things. When the app is redeployed, it'll list out the steps it's taking into the app's logs in real time. Example: https://www.sololearn.com/post/1070667 "Stopping all processes with SIGTERM", "Process exited with status 143", and "Starting process with command `python3 main.py`" are outputted to the logs during every reboot (whether rebooted automatically (it cycles every 24 hours) or manually). Following a bit of research, I've learned that SIGTERM is in reference to one of Python's modules "signal" after importing the "signal" module and entering `print(signal.__dict__.keys())`. After noting the information & example above, my question is as follows: Given the information above, is it possible to use `signal.SIGTERM` to reboot an application (that is *not* running on my local machine) by executing a command from the command-line (in Discord)? If so, how might it be done programmatically? How might I go about directly identifying/referencing a process prior to restarting it (programmatically)?