B4J Question Is it possible to reboot the server (Windows Server 2012 / 2016) from B4J non-UI app?

labcold

Member
Licensed User
Longtime User
I am trying to automate system disaster recovery in a real time multi-server system with many instances of B4J non-ui apps running on each server.
I need to be able to force a reboot of a server itself under certain circumstances.
The server OS is already setup to launch the apps again on startup.
Is there an 'elegant' way of doing that?

Also what is the best way to remote launch a B4J non-ui app on a server from another machine?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
jShell is the answer to both questions.

Shutdown: https://its.uiowa.edu/support/article/109196
You probably need to run it with cmd /c and pass the command as parameter.

Also what is the best way to remote launch a B4J non-ui app on a server from another machine?
You can create an "administrator" B4J server that tracks the running processes and starts the other servers when needed.
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Also what is the best way to remote launch a B4J non-ui app on a server from another machine?
If you have a Windows OS on your servers: I have been using a simple utility call "Restart On Crash" for this purpose for a good many years on several systems (including on AWS EC2 instances and headless/legless mini PCs in remote locations) and it never falters.

It can be configured to automatically launch when Windows is started and will then launch (and monitor) any apps you have told it about.

It is very easy to use (install and tailor in minutes) and even has a flat file log which I monitor with a B4J app that SMSs me if anything falls over.

Just google "restart on crash" it is readily available - FREE.

Highly recommended...
 
Last edited:
Upvote 0
Top