Minecraft Server restart after action - server

I am trying to code a LoL plugin for my MC-server and I need everytime, to restart the server when the game ends. So if the last player dies or something the server needs to restart, to set everything on default. My problem is, I can't get the line of code that restarts the server. I hope you can help as fast as possible

what I would do is [assuming you are using spigot], go to your spigot.yml file and change the "restart script" line to whatever your start.bat/sh file is called. Then, when someone dies use Bukkit.getConsoleSender().dispatchCommand(Bukkit.getConsoleSender(), "restart");

Related

KDB script keeps crashing

I've been finding recently that my KDB launch script is crashing. I need to restart my computer and then it will run fine. I launch KDB from a CMD prompt and I can't figure out where to look to see what process is running in the background which is causing it to crash. Does anybody know what I should check?
Thanks.
Trying running a blank kdb instance with just:
set QHOME=C:\q
set PATH=%PATH%;c:\q\w32
and then
q -p 1234
(doesn't need to be in a batch script, you should be able to just run those commands in a cmd prompt). If kdb comes up then kdb isn't the problem.
Then try to manually load the startup script to see if the problem is there:
q)system"l C:\\q\\ServerFiles\\server.q"
If this works fine then the problem isn't there. The last place it can be is in the database/directory load, so load that:
q)system"l c:\\q\\files"
If none of these cause an error then something else is affecting your kdb instance, either something running on a timer (check .z.ts) or something is connecting externally
So I did finally discover what the issue was. I had a few instances of KDB that would run via Task Scheduler in the evening and then close. One of the instances wouldn't end and so it was continually running. This would cause KDB to crash since there was already an instance running. The restart would stop the process so it could be run again. I deleted the task scheduler event and recreated it and now the event runs KDB and closes the way it is supposed to. Thanks for all of the help in trying to figure this out!

Powershell Terminates After Few Seconds

Hi Stackoverflow Community,
I have a weird thing that is happening on my server. I was about to check if a certain script that is running okay on one of my servers on another server with same configuration. However, I realized that once I try to execute it, it will open for a time and start running only to terminate without finishing the whole script. Even doing a -noexit can't do anything about it and will immediately terminate the process without showing any error.
I tried to open Powershell console on its own without running any script, and guess what, still closes after a few seconds. Any idea why is this happening? Thanks!
All the best!

How to restart an exe when it is exits in windows 10?

I have a process in windows which i am running in startup. Now i need to make it if somehow that process get killed or stopped i need to restart it again in Windows 10?
Is there any way. Process is a HTTP server which if somehow stopped in windows i need to restart it. I have tried of writing a power-shell in which I'll check task-list status of process and then if not found I'll restart but that is not a good way. Please suggest some good way to do it.
I have a golang exe; under a particular scenario my process got killed or stopped i need to start it up again automatically. This has to be done imediately after the exe got killed. What is the best way to achieve this?
I will give you a brief rundown. You can enable Audit Process Termination in local group policy of the machine as shown below. In your case, success audits would be enough. Please note that the pic is for Windows 7. It may change with OS.
Now every time a process gets terminated, a success event will be generated and written to the security eventlog.
This will allow you to create a task scheduler that triggers on the generation of this event that calls a script that would run the process again. Simple right?
Well, you might have some trouble setting that task up especially when you want to pass details about the generating event to the script. This should help you get through that.
You can user Task scheduler for this purpose. There is a option of "restart on failure" which can be selected and whenever your process get failed it will restart again.
Reference :- https://social.technet.microsoft.com/Forums/windowsserver/en-US/4545361c-cc1f-4505-a0a1-c2dcc094109a/restarting-scheduled-task-that-has-failed?forum=winserverManagement

How to remain running status of zopectl and plone?

Last week my lab's power outage occurred and the web server went out.
And after then, my webpage doesn't work anymore. My webpage is using plone and zope.
So I first went to the directory /Plone/zinstance/bin
typed ./instance
then did zopectl start
then I typed ./plonectl start.
But the problem is the following : everytime I start zopectl and plonectl, the daemon process soon died.
The command line is like this.
I don't know what is the problem and what should I do. Anyone who knows well about plone and zopectl please help me.
Try ./instance fg. If you have an error it will be displayed in the console.
(fg - means running it in the foreground)

hubot coffee script - how to set and get brain into file

How do I save the robot brain into a file and load brain data from the file again?
I need it to keep brain persistence in case hubot crashes and want to use his last thoughts when getting it up again.
I have faced the same problem but this worked for me. In order to start redis-brain, you will have to install redis from your browser(same for Windows,Linux, etc,.). After downloading, go to command prompt and open it as an "Admin". In cmd go to Program Files and open Redis and run this "redis-server.exe". Now you have completed setup redis-brain for your project. Hope this would help you!