Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6356709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:01:15+00:00 2026-05-24T23:01:15+00:00

I just finished my app and would like to deploy it. But how to

  • 0

I just finished my app and would like to deploy it. But how to run my app as a service/deamon?

A google search showed some different approches using some python libraries, twisted and Can I run a Python script as a service?. But can’t figure out how to do it.

Any one done this? Is there a best-practice approach?

..fredrik

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:01:17+00:00Added an answer on May 24, 2026 at 11:01 pm

    As you want your application to run standalone (if i understood correctly), you could handle this like with any other (non-web) application.

    If you just want your program to run in the background, you could read this receipe that explains how to create a daemon application and has a nice discussion about this topic (in the comments).

    On the other hand, if you want to make a “system daemon” with your app (which starts at every system’s startup), i’d go with a shell script. To see how to create startup scripts for your system, you could get inspiration from the other startup scripts on your machine. A solution would be to run your program in the background with python my_app.py & (from the startup script), and then use the $! variable to get the process’ pid and store it to a file, this way you would also be able to stop your process by reading the “pid file” and use the kill command (sending a SIGINT to your process will provoke a KeyboardInterrupt exception to be raised in your application).

    EDIT:

    In your question comments, you say using python main.py & would be unsafe as the application wouldn’t restart if it failed/crashed, but that’s the same with any other daemon on your system (for example, if Apache crashed, it would’nt restart by itself). If you want to restart your application if it crashes, you would have to write a 2nd daemon, that would check at regular intervals if your application is still running, and restart it if needed.

    About the logging thing, you can either make your application output to stdout/stderr and redirect it from the startup script (python main.py &> /path/to/app.log &) or handle logging from your application, using the logging module.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just finished up my first mvc4 app. Everything is working great until I deploy
I just finished creating a large online flex app with 43 different screens. I
I just finished a Django app that I want to get some outside user
I'm a rails novice and just finished my first rails app(as far as I
I am relatively new to python and app engine, and I just finished my
I just finished this script it works well, but I am struggling to pass
I just finished setting up my Eclipse with the Android plug-in. (i.e https://dl-ssl.google.com/android/eclipse/ )
I just finished an app to import a fairly simple XML data file into
I'm new to computer coding and have just finished coding an app and tested
I am new to WCF. I just finished my first WCF Service Project and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.