Python Forum
Run a Python script reliable on a server
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Run a Python script reliable on a server
#1
Hello,

I have written my first python application for my server and I’m not sure how to run it reliably. What is the most robust and professional way to run and reset it automatically?

Right now I’m running it in a screen session. Should I create a daemon or write an additional watchdog, which monitors all events? My highest priority is uptime. I have searched quite a lot, but haven’t found a good solution. Thank you for your answers!

Best regards

Chris
Reply
#2
It's difficult to determine exactly what you are looking for.
see: https://python-forum.io/misc.php?action=help&hid=19
Reply
#3
Maybe I explain my problem in more detail:

I have a python application “important_service.py”, which does some networking and database stuff. It runs all the time on a dedicated server with Debian 10. The application itself runs really stable, but I’m not sure how to run it on the server and do the error handling, that it resets automatically in case of an reboot or memory error without intervention.

Right now I just open a screen session over ssh and started the script with “python3 important_service.py“ and detach the session afterwards. But in case of an error it just stop and has to restart manually. Imagine the program contains the flight software of a spaceship. How would you configure the script execution in order to get the highest safety standard?
Reply
#4
Have you checked PyPi.org?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Triggering a ps1 script in remote windows server via http python request jasveerjassi 1 365 Jan-26-2024, 07:02 PM
Last Post: deanhystad
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,199 Jun-29-2023, 11:57 AM
Last Post: gologica
  How to modify python script to append data on file using sql server 2019? ahmedbarbary 1 1,217 Aug-03-2022, 06:03 AM
Last Post: Pedroski55
  Real-Time output of server script on a client script. throwaway34 2 2,049 Oct-03-2021, 09:37 AM
Last Post: ibreeden
  How to take the tar backup files form remote server to local server sivareddy 0 1,895 Jul-14-2021, 01:32 PM
Last Post: sivareddy
  Reliable rabbitmq consumer kashcode 1 1,568 Dec-18-2020, 02:37 PM
Last Post: ndc85430
  run a health check script on cloud server through paramiko amritjsr 4 3,236 Jul-21-2020, 02:30 AM
Last Post: amritjsr
  How to kill a bash script running as root from a python script? jc_lafleur 4 5,883 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  Python long running script - causes RDP failure to server? william101 1 2,330 Jun-08-2020, 08:18 AM
Last Post: nuffink
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,291 May-28-2020, 05:27 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020