How to run jts3servermod as a service?

Started by nmbrg, May 19, 2018, 09:31:28 AM

Previous topic - Next topic

nmbrg

I would like a guide on how to make the jts3servermod run as a service on windows.

I know there is a manual/readme with some info but its a long way from perfect and there is a lack of information on there.. Or at least it's very unclear on exactly how to do.

So if someone could explain to me in a clear way on how to make it run as a service I would be really thankful!

When i try to do as the readme says I get an error when trying to "net start" the service, so I guess either the manual is missing something, is unclear on exactly what to do, or I'm doing something wrong

Error message:
C:\Windows\system32>net start jts3servermod
The JTS3ServerMod service is starting.
The JTS3ServerMod service could not be started.

A service specific error occurred: 1.

More help is available by typing NET HELPMSG 3547.

C:\Windows\system32>net helpmsg 3547

A service specific error occurred: ***.


And in Event Viewer:
The JTS3ServerMod service terminated with the following service-specific error:
Incorrect function.

Stefan1200

Make sure, that you used the InstallWindowsService.cmd, if you have the 32 bit version of the Java Runtime installed. If you have the 64 bit version of the Java Runtime installed, you have to use the InstallWindowsService_amd64.cmd.

If you did this wrong, remove the wrong Service installation with the right Remove script frist.

nmbrg

When I installed jts3servermod there were only one installwindowsservice.cmd.
Not two named 32 and 64 bit.

Stefan1200

Then you use an old version of the JTS3ServerMod, already 16 month ago I added the scripts.

nmbrg

actually i've been updating. But i havent bother to update anythging else than the .jar's.
I downloaded the latest version and copied the tools folder to get all the .cmd's.

So now the service installed correctly!

But instead im getting poked on the teamspeak server from the bot telling me there is errors.
Quote"Since last bot start 2 exception errors occured. Please read the chat message to know more"

And when checking the chat message.
Quote"Important: Already 2 exception errors occured since last bot start 16:34 hours ago. Please check the log file of this bot at C:\Program Files\JTS3ServerMod\tools\..\JTS3ServerMod_server1.log to solve this issues! You can confirm this message by answering with: !botconfirmerrors"

Dont know why it says "tools" folder. But there is no log file at that directory.
And looking in the JTS3ServerMod_server1.log file under C:\Program Files\JTS3ServerMod\ i find this:
Quote2018-05-19 13:39:48   Function mute   ERROR   The file you set at config key "mute_file" does not exist or missing permission for reading, check file path: C:\Program Files\JTS3ServerMod\tools\procrun\amd64\config\server1\mutemessages.cfg
2018-05-19 13:39:48   Function mute   ERROR   Exception in loadConfig(), disable() or activate()!
2018-05-19 13:39:48   Function mute   EXCEPTION   de.stefan1200.jts3servermod.BotConfigurationException: Mute Mover message could not be loaded!
2018-05-19 13:39:48   Function badnick   ERROR   Bad Nickname Check config file you set at config key "badnick_file" does not exist or missing permission for reading, check file path: C:\Program Files\JTS3ServerMod\tools\procrun\amd64\config\server1\badnickname.cfg
2018-05-19 13:39:48   Function badnick   ERROR   Exception in loadConfig(), disable() or activate()!
2018-05-19 13:39:48   Function badnick   EXCEPTION   de.stefan1200.jts3servermod.BotConfigurationException: Bad Nickname Check rules could not be loaded!

And im still not sure why it checks under the tools directory. There is no .cfg's there.
Thats not the default folders when installing JTS3ServerMod.
The default is: C:\Program Files\JTS3ServerMod\config\server1

Do i need to alter anything in the .cmd for creating the service? (thats what i meant with the instructions beeing close to worthless since they are very unclear)

Stefan1200

well, don't miss the .., which means cd up, the path
C:\Program Files\JTS3ServerMod\tools\..\JTS3ServerMod_server1.log

is the same as
C:\Program Files\JTS3ServerMod\JTS3ServerMod_server1.log

nmbrg

#6
Ok, then explain to me why the log (if you looked at my post) says this:

Function mute   ERROR   The file you set at config key "mute_file" does not exist or missing permission for reading, check file path: C:\Program Files\JTS3ServerMod\tools\procrun\amd64\config\server1\mutemessages.cfg

and

Function badnick   ERROR   Bad Nickname Check config file you set at config key "badnick_file" does not exist or missing permission for reading, check file path: C:\Program Files\JTS3ServerMod\tools\procrun\amd64\config\server1\badnickname.cfg

obviously what you're saying isnt true as the log file, without a doubt, reports that it has checked in the tools\procrun\amd64\config\server1\ for the config files.
When it, if  what you're saying is true, should check at \JTS3ServerMod\JTS3ServerMod_server1.log

And once again, the log says its not checking there.

Can you correct the .cmd for installing the service to check the correct folders?
Or tell me (us) how to alter it to be correct?

Stefan1200

This happens because you use a config file from an old JTS3ServerMod version. This is okay in general, but since the windows service is starting from a different current directory, there are some things which have to be changed.

Changing to the following lines should help:
badnick_file = %apphome%config/server1/badnickname.cfg
mute_file = %apphome%config/server1/mutemessages.cfg

nmbrg

Ok, the config files are only like 3 versions old or something.
but anyway, that seemed to do the trick.

thanks for the help!