Comments (9)
As far as i can tell, it's (was ?) working, as long as you have the "sol.json" file in the same folder than the binary (i should see for adding a --config parameter, by the way).
With your configuration and current code i get :
INFO: 2017/11/15 20:40:31 sol.go:20: Application [sleep-on-lan version 1.0.0-SNAPSHOT "FIRST_ITERATION"]
INFO: 2017/11/15 20:40:31 sol.go:21: Loaded configuration from [/go/src/sol.json]
INFO: 2017/11/15 20:40:31 sol.go:23: Now starting sleep-on-lan, hardware IP/mac addresses are :
INFO: 2017/11/15 20:40:31 sol.go:25: - local IP adress [127.0.0.1/8], mac []
INFO: 2017/11/15 20:40:31 sol.go:25: - local IP adress [172.17.0.16/16], mac [02:42:ac:11:00:10]
INFO: 2017/11/15 20:40:31 sol.go:28: Available commands are :
INFO: 2017/11/15 20:40:31 sol.go:30: - operation [poweroff], command [poweroff], default [true], type []
INFO: 2017/11/15 20:40:31 listener_http.go:70: Registering route [/]
INFO: 2017/11/15 20:40:31 listener_http.go:70: Registering route [/poweroff]
INFO: 2017/11/15 20:40:31 listener_http.go:70: Registering route [/quit]
INFO: 2017/11/15 20:40:31 listener_http.go:70: Registering route [/wol/:mac]
____ __
/ __/___/ / ___
/ _// __/ _ \/ _ \
/___/\__/_//_/\___/ v3.2.3
High performance, minimalist Go web framework
https://echo.labstack.com
____________________________________O/_______
O\
INFO: 2017/11/15 20:40:31 listener_udp.go:12: Now listening UDP packets on port [9]
⇨ http server started on [::]:8009
INFO: 2017/11/15 20:40:31 listener_udp.go:12: Now listening UDP packets on port [7]
root@6741062f3330:/go/src#
root@6741062f3330:/go/src# curl localhost:8009/poweroff
INFO: 2017/11/15 20:40:38 listener_http.go:131: Executing [poweroff]
INFO: 2017/11/15 20:40:38 sleeper_linux.go:9: Executing operation [poweroff], type [poweroff], command [poweroff]
INFO: 2017/11/15 20:40:38 sleeper_linux.go:17: Sleep implementation [linux], sleep command is [poweroff]
ERROR: 2017/11/15 20:40:38 sleeper_linux.go:20: Can't execute command [poweroff] : exec: "poweroff": executable file not found in $PATH
from sleep-on-lan.
Hello, it'd seem I'm having the same issue, just tried this out on my linux-mint machine
Configuration (~/Desktop/SoL/linux/sol.json
):
{
"Listeners": [
"UDP:9",
"HTTP:8009"
],
"LogLevel": "DEBUG",
"BroadcastIP": "255.255.255.255",
"Commands": [
{
"Operation": "nap",
"Command": "pm-suspend",
"Default": "false"
}
]
}
Upon running the 'nap' command (I created this just for test purposes...) I don't see any result from the back-end (sudo ~/Desktop/SoL/linux/sol
http://localhost:8009/nap/
):
INFO: 2017/11/16 19:53:13 sol.go:19: Now starting sleep-on-lan, hardware IP/mac addresses are :
INFO: 2017/11/16 19:53:13 sol.go:21: - local IP adress [xxxx:xxxx:xxxx:xxxx:xx/64], mac [xx:xx:xx:xx:xx:xx]
INFO: 2017/11/16 19:53:13 sol.go:21: - local IP adress [xxxx:xxxx:xxxx:xxxx:xx/64], mac [xx:xx:xx:xx:xx:xx]
INFO: 2017/11/16 19:53:13 sol.go:21: - local IP adress [127.0.0.1/8], mac []
INFO: 2017/11/16 19:53:13 sol.go:21: - local IP adress [::1/128], mac []
INFO: 2017/11/16 19:53:13 sol.go:21: - local IP adress [192.168.1.99/24], mac [xx:xx:xx:xx:xx:xx]
INFO: 2017/11/16 19:53:13 sol.go:21: - local IP adress [xxxx:xxxx:xxxx:xxxx:xx/64], mac [xx:xx:xx:xx:xx:xx]
INFO: 2017/11/16 19:53:13 sol.go:21: - local IP adress [172.17.0.1/16], mac [xx:xx:xx:xx:xx:xx]
INFO: 2017/11/16 19:53:13 sol.go:21: - local IP adress [xxxx:xxxx:xxxx:xxxx:xx/64], mac [xx:xx:xx:xx:xx:xx]
INFO: 2017/11/16 19:53:13 listener_udp.go:13: Now listening UDP packets on port [9]
INFO: 2017/11/16 19:53:13 listener_http.go:126: Now listening HTTP on port [8009], urls will be :
INFO: 2017/11/16 19:53:13 listener_http.go:129: - http://192.168.1.99:8009/sleep
INFO: 2017/11/16 19:53:13 listener_http.go:129: - http://192.168.1.99:8009/wol/[A-z]+
INFO: 2017/11/16 19:53:13 listener_http.go:129: - http://192.168.1.99:8009/
Yes, this is after running the command through HTTP. Browser side, I get the usual XML result:
<result>
<application>sleep-on-lan</application>
<hosts>
<host ip="xxxx::xxxx:xxxx:xxxx:xx/64" mac="xx:xx:xx:xx:xx:xx"/>
<host ip="127.0.0.1/8" mac=""/>
<host ip="::1/128" mac=""/>
<host ip="192.168.1.99/24" mac="xx:xx:xx:xx:xx:xx"/>
<host ip="xxxx::xxxx:xxxx:xxxx:xxxx/64" mac="xx:xx:xx:xx:xx:xx"/>
<host ip="172.17.0.1/16" mac="xx:xx:xx:xx:xx:xx"/>
<host ip="xxxx::xx:xxxx:xxxx:xxxx/64" mac="xx:xx:xx:xx:xx:xx"/>
<host ip="xxxx::xxxx:xxxx:xxxx:xxxx/64" mac="xx:xx:xx:xx:xx:xx"/>
</hosts>
<listeners>
<listener active="true" port="9" type="UDP"/>
<listener active="true" port="8009" type="HTTP"/>
</listeners>
</result>
If there's any additional information you'd like, please ask.
from sleep-on-lan.
Two questions (to try to understand) (i'll add additional logs anyway) : is you sol binary in the same folder than sol.json ? And are you running the sol binary from this folder or through an absolute (or even relative path other than "./") ?
from sleep-on-lan.
- The sol.json file is in the same directory as the sol file
- I have tried both ./sol as it was convenient, and the absolute path.
from sleep-on-lan.
Can you try with the latest SNAPSHOT 1.0.2 ? I'm surprised to not see any logs about configuration loading on your side (telling which file is used (if any) or that configuration is not found) (logs were already in place). On my side, whatever the situation (linux with absolute or relative path, windows, ...) i still have the logs.
https://github.com/SR-G/sleep-on-lan/releases/tag/1.0.2-SNAPSHOT
from sleep-on-lan.
It'd seem I've encountered a new issue with your pre-release, that being it won't even recognize the file:
from sleep-on-lan.
My bad ! Have compiled it inside an alpine linux docker container, forgot to add the proper compilation flags. New SNAPSHOT just uploaded should be ok (tested additionnaly on standard amd64 archlinux on my side this time).
Github SNAPSHOT is the same but zip content generated on 22:57 : https://github.com/SR-G/sleep-on-lan/releases/tag/1.0.2-SNAPSHOT
from sleep-on-lan.
That appears to have fixed the issue, it now reports that I'm using the json file and correctly implements the command as intended. Thank you!
I'm sure I'll break something again soon, though. Stand-by!
from sleep-on-lan.
Thanks for the test and confirmation.
Closing the issue for now, feel free to re-open if needed.
from sleep-on-lan.
Related Issues (20)
- Switch logging framework to logrus
- Add missing target platform
- add commands doesn't work HOT 12
- Only allow expected command types in custom commands definition
- Log file or event log on Windows? HOT 2
- Incorrect example for Commands? HOT 3
- Have better "default configuration" generated
- Split the ZIP distribution into one archive per platform
- Split README.md into separated pages
- New --verbose parameter
- Extra default filenames
- Logs where not displaying timestamps in line with system's timezone
- No response for HTTP sleep HOT 2
- Have extra delay before executing command HOT 3
- PC sleeps immediately after Wake on Lan after having used sleep on lan HOT 5
- Wake on LAN works strange when service work HOT 1
- Create non-console version, so conhost.exe doesn't also need to run HOT 3
- VirusTotal scan results HOT 1
- Build binaries for x86 architecture HOT 1
- Commands cannot execute. I think the Execute function in SR-G/sleep-on-lan/src/utils_system.go is bugged.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sleep-on-lan.