Git Product home page Git Product logo

Comments (2)

fohrloop avatar fohrloop commented on August 17, 2024

I did a quick look on this topic. I'm not an expert on this but it seems that the reason why a script typically stops when someone exits SSH is a SIGHUP signal which gets send to all processes when terminal window with SSH connection is closed. The typical solutions involve using nohup, screen or tmux. This is not about keeping CPU awake, but about keeping a process from not getting stopped by a HUP signal. Therefore, I kind of think this might be out of scope of wakepy. If nohup yourscript.py & just works, why would wakepy need to implement a solution? If there was a solution, should that be some separate mode, like ignore.hup ?

In order to really consider adding a ignore.hup mode, should:

  • List at least one real use case, and explain why wakepy would be needed instead of nohup, screen or tmux?
  • Is this technically possible? Would it be as simple as:
import logging
import signal

logger = logging.getLogger(__name__)

def handler(signum, frame):
  logger.warning(f"Received {signum} signal. Doing nothing.")

signal.signal(signal.SIGHUP, handler)

from wakepy.

fohrloop avatar fohrloop commented on August 17, 2024

Related: #203

Also could be possible to make wakepy ignore SIGHUP, by default but that's probably a bit too intrusive. Another possibility would be to add some nohup=False parameter to keep.running() and keep.presenting().

from wakepy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.