Page 1 of 2
Feature request
Posted: Sat Mar 14, 2015 3:05 pm
by Mastiff
Well, I may scare you now, since the previous one turned out to be a lot of work!
Still I take the chance: Would it be possible to add a command to restart the server through the control port TCP interface? As you know I use this for my Tellstick Duo with EventGhost through Walter's plugin, and it would be nice if EventGhost could restart the ONH if something wrong happens. Would that be possible/easy?
Re: Feature request
Posted: Sat Mar 14, 2015 5:26 pm
by Nasty76
Well I was using scipt which ssh nethome pi and give command which restart nethome
Re: Feature request
Posted: Sat Mar 14, 2015 7:20 pm
by krambriw
I have seen that the exec command is available in the TCP Command port, but not tested, since it says it is not supported from remote...
If there are any syntax example on how to restart ONH from outside, I would appreciate...some sample code line
Re: Feature request
Posted: Sat Mar 14, 2015 8:21 pm
by Nasty76
Re: Feature request
Posted: Sun Mar 15, 2015 8:12 am
by stefangsbb
There is actually an undocumented feature called "upgradeServer" in the settings page (this is the EventBroker-Item). If you call that method, ONH will execute the "UpgradeCommandScript" and then shut down, so if the script waits a while and then starts a new ONH, then it works as a restart function.
It might however be more robust to do a harder restart via the service as suggested.
Re: Feature request
Posted: Sun Mar 15, 2015 10:54 am
by Mastiff
Nasty76, isn't that for Raspberrys and stuff like that? I don't do anything smaller/more primitive than an Windows Xeon server with virtual machines.
Stefan, I guess using a restart on the service is the best way, then. Thanks! I'll probably use something that looks like my restart of the openVPN tunnel:
Code: Select all
net stop openvpnservice
PING 1.1.1.168 -n 1 -w 5000 >NUL
PING 1.1.1.168 -n 1 -w 5000 >NUL
net start openvpnservice
But I'm actually not sure how to stop ONH, it doesn't show in the services list. I use this (standard) batchfile to start it:
Code: Select all
cd lib
del swt.jar
del rxtxSerial.dll
copy ..\os\rxtxSerial_32.dll rxtxSerial.dll
start javaw -jar home.jar
What would the correct way to stop it be? So far I've only stopped it by right clicking and choosing stop.
Re: Feature request
Posted: Sun Mar 15, 2015 12:23 pm
by krambriw
To use under Windows, you need to run ONH as a service. I did configure this a couple of years ago with a java service wrapper
http://wrapper.tanukisoftware.com/doc/e ... ml#service
but I do not exactly remember how the syntax looked like...
Or maybe this one is a better option:
http://sourceforge.net/projects/yajsw/
Re: Feature request
Posted: Sun Mar 15, 2015 1:06 pm
by Mastiff
Thanks! I'll have to look at that when I get there. It's a bit more advanced, so I want a full backup of the system first.
Re: Feature request
Posted: Sun Mar 15, 2015 2:08 pm
by Nasty76
Hhmmm you can use ssh any machine. That only need ssh server.
Btw what you try do
Re: Feature request
Posted: Sun Mar 15, 2015 3:09 pm
by krambriw
Or in Windows, use pskill to kill the javaw.exe process and then run the .bat file again
https://technet.microsoft.com/en-us/sys ... 96683.aspx