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 712307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:50:01+00:00 2026-05-14T04:50:01+00:00

Common situation: I have a client on my server who may update some of

  • 0

Common situation: I have a client on my server who may update some of the code in his python project. He can ssh into his shell and pull from his repository and all is fine — but the code is stored in memory (as far as I know) so I need to actually kill the fastcgi process and restart it to have the code change.

I know I can gracefully restart fcgi but I don’t want to have to manually do this. I want my client to update the code, and within 5 minutes or whatever, to have the new code running under the fcgi process.

Thanks

  • 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-14T04:50:02+00:00Added an answer on May 14, 2026 at 4:50 am

    First off, if uptime is important to you, I’d suggest making the client do it. It can be as simple as giving him a command called deploy-code. Using your method, if there is an error in their code, your method requires a 10 minute turnaround (read: downtime) for fixing it, assuming he gets it correct.

    That said, if you actually want to do this, you should create a daemon which will look for files modified within the last 5 minutes. If it detects one, it will execute the reboot command.

    Code might look something like:

    import os, time
    CODE_DIR = '/tmp/foo'
    
    while True:
        if restarted = True:
            restarted = False
            time.sleep(5*60)
    
        for root, dirs, files in os.walk(CODE_DIR):
            if restarted=True:
                break
            for filename in files:
                if restared=True:
                    break
                updated_on = os.path.getmtime(os.path.join(root, filename))
                current_time = time.time()
                if current_time - updated_on <= 6 * 60: # 6 min
                    # 6 min could offer false negatives, but that's better
                    # than false positives
                    restarted = True
                    print "We should execute the restart command here."
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following common situation: You have some MainView in your Cocoa application, loaded
The situation: We have a library project that houses much of our code for
The Situation: I have some custom components in my layout. I have a common
I have a very common situation. I have a file, and I need to
I have a very common situation here. And for years I haven't found if
Situation with Thai text on a client site is that we can't control where
I have a (common) situation where I am currently returning a result that is
I've got a common situation where you have two variables (xSpeed and ySpeed) which
i'm coming into C++ from Java, and have a common design situation in which
I don't have the code available right now, but I'll describe my situation 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.