Coder Social home page Coder Social logo

Comments (4)

kannibalox avatar kannibalox commented on August 21, 2024

Not to say that having it directly in the code wouldn't be useful, but you can already accomplish your goal with the available event bindings and systemd-notify:

# Startup
method.set_key = event.system.startup_done, notify_systemd, "execute=/bin/systemd-notify,--ready,--status,(cat,SESSION=,(session.name)),--pid,(system.pid)"
# Shutdown
method.set_key = event.system.shutdown, notify_systemd, "execute=/bin/systemd-notify,STOPPING=1"

from rtorrent.

jesec avatar jesec commented on August 21, 2024

Great idea.

I don't want the binary to link against libsystemd, though. Is there a standalone solution?

from rtorrent.

vamega avatar vamega commented on August 21, 2024

@kannibalox thanks I wasn’t aware of that. Should have looked at the configuration options more closely.

@jesec I could probably make this work by opening a Unix datagtam socket and sending the data myself.

Is there a reason you’re opposed to linking against systemd?

from rtorrent.

jesec avatar jesec commented on August 21, 2024

Not all systems have systemd or libsystemd. You may find this useful: https://github.com/lnicola/sd-notify.

i knew this project is not in Rust, but you can check out the logic.

from rtorrent.

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.