0

I wanted to ask a question, what is the mature way to start on boot and restart on crash a python script? I'am using the following script to build a https server: python https server with authentication, which is ran manually by me with screen on every boot. Is there any cleaner solution to my problem? Thanks in advance.

P.S For all the future people thinking, why just not use Nginx or Apache? - Simple anwser why drive a Lamborghini to a grocery store, if I can just drive with my bike? Both fulfill their purpose, I wouldn't use even a little bit of the power that both of these servers provide.

1
  • 1
    Please do some research. Questions like this have been asked, and answered, many, many times, both on the web and these sites. If you have searched already, please tell us what you searched for and what or why the results did not help you.
    – C. M.
    Apr 25, 2021 at 7:04

1 Answer 1

0

Did you look into Services? You can get more information here: https://www.freedesktop.org/software/systemd/man/systemd.service.html Services are shell scripts that have a few functions that can be called to control your program, e.g start, stop, etc.. there is also functionality to automatically start on boot like other services you may know (for example the OpenSSH server has a service to control it)

1
  • 1
    Please use comments instead of answers when making comments, suggestions, or asking questions--without actually providing an answer. Others seeking an answer to their own question will look at questions that have answers, expecting to see an answer and get frustrated when there is no real answer provided.
    – C. M.
    Apr 25, 2021 at 7:02

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.