Git Product home page Git Product logo

Comments (5)

girque avatar girque commented on May 29, 2024

Maybe the user permission issue was the source of the problem after all:

  • I followed this tutorial to allow non-root user to execute the command sudo shutdown -h now
  • I also changed the ownership of the /var/log/sleep-on-lan.log to be able to launch the nohup /path/to/sol_binary > /var/log/sleep-on-lan.log 2>&1 & as non-root
  • The SoL followed by immediate WoL worked well (in my case SoW and WoW)
  • The log file now only shows 1 command execution for 1 UDP SoL packet sent

from sleep-on-lan.

SR-G avatar SR-G commented on May 29, 2024

Ok hadn't time to investigate your main issue (which i've never encountered on my side), glad you solved it by yourself.

For non-root execution, i was suggesting the setcap method in the global README.md (https://github.com/SR-G/sleep-on-lan), but other methods may of course work.

For your additional comments :

  • A Basic Auth has just been added (see #17), but new SNAPSHOT not uploaded yet
  • For a "REST state", could be nice but i don't see how to do that : i can easily add a "/isUpAndRunning/" HTTP method, but the "/isAsleep" will never work as soon as the server you're trying to reach is offline ... or were you speaking about a "/state/<MAC_ADDRESS>/" command that would remotely tells the state of another remote server (would then probably just be a wrapper around some kind of ping commands) ?

from sleep-on-lan.

girque avatar girque commented on May 29, 2024

Yes I followed the setcap technique to listen on port 9. But still permissions to write in /var/log/sleep-on-lan.log and also use shutdown command are needed. As you said there are many methods..

  • Thank you for the Basic Auth, it will allow to use HTTP for SoW. It's more reliable than UDP packets.
  • Yes exactly I was talking about a kind of "ping wrapper" called by a "/isUpAndRunning/" HTTP method. Then a simple browser is enough to get this boolean value (no console needed). For example in case someone else is using the computer maybe it is better to do not shut it down.

from sleep-on-lan.

SR-G avatar SR-G commented on May 29, 2024

Ok, would #18 do the trick, could you review it ? (already coded, awaiting to see if it would meet your needs)

Would allow :

  • to see if the server where sol is running is online or offline (immediate result)
  • to see if another server is online or offline (will execute a IMCP request to the remote IP)

Questionning another server through MAC addresses rather than IP would be possible but a little bit more complicated (would need to know which network interface to use in order to make the ARP query on).

from sleep-on-lan.

girque avatar girque commented on May 29, 2024

Yes it is perfect like this. We can get the status of other computers in the local network. No need for more NAT/PAT or SSH... to ping them, quite useful and simple.
I suggest you update the doc accordingly when released ;)
Cheers !

from sleep-on-lan.

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.