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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:30:07+00:00 2026-06-15T00:30:07+00:00

I have a long-running python program that I’m trying to run on a remote

  • 0

I have a long-running python program that I’m trying to run on a remote server.

I’ve looked at “How to keep processes running after ending ssh session?”, ”
How to start process via SSH, so it keeps running?”
, “Run a persistent process via ssh”, and a few other topics, but they don’t seem to help.

I’ve tried running the python process with screen (via detaching a screen containing a background process) and nohup, but in both cases, when I exit the ssh session (which–I’m not sure if this matters–is run with X11 forwarding, since the python program is creating some graphics), the ssh session hangs.

The ssh process hangs even if I redirect stdin, stdout, stdout from/to /dev/null.
Killing the ssh session kills the python process. When I kill the ssh, the following error message is printed on the remote server: g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.

Furthermore, I don’t actually want to redirect stdout or stderr to /dev/null, since I want to redirect them to a log file. So I didn’t try running the python process as a daemon. (Perhaps it’s bad that the logging is sent to stdout, I guess…)

What should I do, so that I can: (1) keep my process running after logging out, (2) redirect stdout/stderr to a log file?

(One thing which “worked” was suspending and then rerunning the ssh process [after it hangs] in the background, but what if I want to shut off my computer?)

  • 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-06-15T00:30:08+00:00Added an answer on June 15, 2026 at 12:30 am

    The X11 connection is indeed the problem. Screen takes care of keeping stdin/stdout/stderr connected, and it also protects the program from the HUP signal. However, it does not keep a virtual X server for it to write graphics on.

    So the question is: what do you want with the graphics? If your program really needs to output them, you need to set up a (virtual) X server which it can continue to reach even after the connection is lost. You can connect to this virtual server with vnc, just like you can connect to your screen session.

    Or you can make the program more suitable for running in the background, which means it must not use the X server. In that case, you probably want to output some files which you can then turn into graphics with a separate program when you want to see them.

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

Sidebar

Related Questions

I have a possibly long running program that currently has 4 processes, but could
I have a long-running Python script that I run from the command-line. The script
I have a long-running program on a remote machine and want to be sure
I have a long-running Python server and would like to be able to upgrade
I have put a long running python program in a cron job on a
I have a python program that is running for many days. Memory usage does
I have a python GUI app that uses a long running function from a
I have a long-running process written in Python 2.7 that I would like to
I am attempting to have two long running operations run simultaneously in python. They
I have a long running process that is called via a Nancy Module Get

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.