[GELÖST]JTS3 mithilfe des Scripts als Service - Configs werden nicht gefunden

Started by Naishweb, March 15, 2016, 07:01:13 AM

Previous topic - Next topic

Naishweb

Guten Morgen!
Hatte ein paar Unstimmigkeiten mit dem Fremdskript das bisher meinen Bot unter Windows als Service gestartet hat. Deshalb dachte ich, ich probiere mal das Script, das beim Bot mit bei ist.
Nachdem ich den Service via der cmd installiert habe startet der Bot theoretisch korrekt, jedoch wirft er für alle Fuktionen die eine .cfg Datei im config Ordner diegleiche Fehlermeldung:


2016-03-15 05:35:04 Function idle ERROR The file you set at config key "idle_file" does not exist or missing permission for reading, check file path: config/server1/idlemessages.cfg
2016-03-15 05:35:04 Function idle EXCEPTION de.stefan1200.jts3servermod.BotConfigurationException: Idle Check messages could not be loaded!



  • Rechte des Ordners geprüft (Server2012) -> i.o. System und Administrator haben Zugriff
  • Service probehalber über Dienstoptionen von bisherigem Nutzer (Administrator) ausführen lassen statt über das Systemkonto
  • InstallWindowsService.cmd bearbeitet:
    @echo off
    REM JTS3ServerMod Service Script v2 by Stefan Martens
    REM
    REM If you want, change the path to the JTS3ServerMod tools directory. It has to end with a backslash!
    SET PR_PATH=C:\Stuff\Teamspeak\JTS3ServerMod\tools\
  • config Pfad in InstallWindowsService.cmd hart eingetragen:
    REM Set the path of the JTS3ServerMod_InstanceManager.cfg file
    SET CONFIG_PATH=C:\Install\Teamspeak\JTS3ServerMod\config\JTS3ServerMod_InstanceManager.cfg
  • JTS3ServerMod_InstanceManager.cfg geprüft & geprüft ob in neuer Version Änderungen eingeführt worden sind.
  • JTS3ServerMod_server.cfg geprüft & geprüft in neuer Version Änderungen eingeführt worden sind.

Findet einer den Fehler von mir, den ich nicht finde?
C:\Stuff\Teamspeak\JTS3ServerMod\tools\InstallWindowsService.cmd (standard)
@echo off
REM JTS3ServerMod Service Script v2 by Stefan Martens
REM
REM If you want, change the path to the JTS3ServerMod tools directory. It has to end with a backslash!
SET PR_PATH=%~dp0
REM
REM Set the service name
SET PR_SERVICE_NAME=JTS3ServerMod
REM
REM Set the path of the JTS3ServerMod_InstanceManager.cfg file
SET CONFIG_PATH=%~dp0..\config\JTS3ServerMod_InstanceManager.cfg
REM
REM Set the path to the JTS3ServerMod_InstanceManager.log file
SET LOG_PATH=%~dp0..\JTS3ServerMod_InstanceManager.log
REM
REM Do not change anything below this line!
SET PR_SERVICE_DESCRIPTION=The multifunction Teamspeak 3 server bot from http://www.stefan1200.de
SET PR_JAR=JTS3ServerMod.jar
SET START_CLASS=de.stefan1200.jts3servermod.JTS3ServerMod
SET START_METHOD=main
SET STOP_CLASS=java.lang.System
SET STOP_METHOD=exit
SET STOP_PARAMS=0
SET JVM_OPTIONS=-Dapp.home="%PR_PATH%..\\"

echo Installing JTS3ServerMod service...
echo.

SET AdminTestPath=%windir%\System32\testadmintemp
mkdir "%AdminTestPath%" 2>nul
IF ERRORLEVEL 1 (
  echo You need admin permissions to run this script!
  goto END;
) else (
  rmdir "%AdminTestPath%"
)

"%PR_PATH%procrun\prunsrv.exe" //IS//%PR_SERVICE_NAME% --Description="%PR_SERVICE_DESCRIPTION%" --Install="%PR_PATH%procrun\prunsrv.exe" --Jvm=auto --Startup=auto --StartMode=jvm --StartClass=%START_CLASS% --StartMethod=%START_METHOD% ++StartParams=-config;"%CONFIG_PATH%";-log;"%LOG_PATH%" --StopMode=jvm --StopClass=%STOP_CLASS% --StopMethod=%STOP_METHOD% ++StopParams=%STOP_PARAMS% --Classpath="%PR_PATH%..\%PR_JAR%" --DisplayName="%PR_SERVICE_NAME%" ++JvmOptions=%JVM_OPTIONS% --StdError=auto
IF ERRORLEVEL 1 (
echo.
echo Check if the service name %PR_SERVICE_NAME% already exists!
) else (
echo.
echo Now you should be able to start service with:
echo net start %PR_SERVICE_NAME%
)

:END
PAUSE



C:\Stuff\Teamspeak\JTS3ServerMod\JTS3ServerMod_server1.log
2016-03-15 05:35:04 JTS3ServerMod STATUS Virtual bot instance "bot1" starts now (build 6006)
2016-03-15 05:35:04 JTS3ServerMod STATUS Activate log level: INFO
2016-03-15 05:35:04 JTS3ServerMod INFO Successfully loaded function: IdleCheck / idle
2016-03-15 05:35:04 Function idle ERROR The file you set at config key "idle_file" does not exist or missing permission for reading, check file path: config/server1/idlemessages.cfg
2016-03-15 05:35:04 Function idle EXCEPTION de.stefan1200.jts3servermod.BotConfigurationException: Idle Check messages could not be loaded!
2016-03-15 05:35:05 JTS3ServerMod INFO Successful connected to 127.0.0.1!
2016-03-15 05:35:05 JTS3ServerMod INFO Login as "TS3_Server" successful!
2016-03-15 05:35:05 JTS3ServerMod INFO Successful selected virtual server 1!
2016-03-15 05:35:05 JTS3ServerMod INFO Server connection log is activated and will be written into the file: C:\Stuff\Teamspeak\JTS3ServerMod\tools\..\JTS3ServerMod_server1_login.csv
2016-03-15 05:35:05 JTS3ServerMod INFO Creating client database cache...
2016-03-15 05:35:05 JTS3ServerMod INFO Bot started and connected successful, write !botinfo in server chat to get an answer!
2016-03-15 05:35:10 JTS3ServerMod INFO Unloaded all functions!



C:\Stuff\Teamspeak\JTS3ServerMod\config\JTS3ServerMod_InstanceManager.cfg
# JTS3ServerMod Instance Manager config file
#
# Each bot instance need:
# X.instance_enable
# X.instance_name
# X.instance_config_path
#
# Optional:
# X.instance_logfile_path
# X.instance_csvloginlog_path
# X.instance_debug = 1
#
# For X use a number starting from 1. Make sure that you have not more than 10 missing numbers between the instances.
# At least one enabled instance is needed or the bot process will stop after starting.
#
# This file must be saved with the encoding ISO-8859-1!

# A comma seperated list (without spaces) of unique user ids,
# which should be able to use bot full admin commands on all bot instances.
# Bot full admin can also see the TS3 server password and is able to use the !exec command.
# The unique user ids looks like this: xxx=
bot_fulladmin_list = xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=
# User1,User2,user3,user4,user5, user6,user7,user8,user9,user10,user11, user12, user13
# Allow !exec and !execwait commands for bot full admins? 1 = Yes, 0 = No
# This allow you to execute system commands.
# Only use !execwait for commands which quits within some seconds,
# because the bot waits for the end of this command to send you the text output of the program.
# Use !exec for commands with a longer runtime instead,
# this command don't send you any text output, because the bot don't wait for it.
bot_command_exec = 1
# Every time a bot full admin connects to the TS3 server it will be checked if an update for the JTS3ServerMod is available.
# If an update is available, a chat message will be sent to the bot full admin.
# 0 = disable, 1 = final versions, 2 = final and test versions
bot_update_check = 1

# Enable bot instance, 1 = yes, 0 = no
# If 0, you can start the virtual bot instance later by chat command from another running virtual bot instance.
1.instance_enable = 1
# The name is needed to start or stop this virtual bot instance by chat commands. This name has to be unique!
# Don't use spaces in the bot name, only use letters, numbers, minus and underscore!
1.instance_name = bot1
# Path to config file for this virtual bot instance.
1.instance_config_path = %apphome%config/server1/JTS3ServerMod_server.cfg
# Path to log file for this virtual bot instance. Leave empty to disable file logging.
1.instance_logfile_path = %apphome%JTS3ServerMod_server1.log
# Path to connection log file for this virtual bot instance. Will be saved in csv format. Leave empty to disable file logging.
# This function creates a CSV file, which logs when which client (including IP address) connects to the TS3 server.
1.instance_csvloginlog_path = %apphome%JTS3ServerMod_server1_login.csv



C:\Stuff\Teamspeak\JTS3ServerMod\config\server1\JTS3ServerMod_server.cfg
# Config file of the JTS3ServerMod
# http://www.stefan1200.de
# This file must be saved with the encoding ISO-8859-1!
# File created at 2015-10-26 10:58:30

# Teamspeak 3 server address
ts3_server_address = 127.0.0.1
# Teamspeak 3 server query port, default is 10011
ts3_server_query_port = 10011
# Teamspeak 3 server query admin account name
ts3_server_query_login = XXXX
# Teamspeak 3 server query admin password
ts3_server_query_password = XXXX
# Teamspeak 3 virtual server ID or -1 to use ts3_virtualserver_port
ts3_virtualserver_id = 1
# Teamspeak 3 virtual server port, only needed if ts3_virtualserver_id is set to -1
ts3_virtualserver_port = 9987

# Channel id, the bot will join into it after connecting. If not wanted, use a negative number like -1.
# Don't set the default channel here, because the bot is already in the default channel after connecting.
bot_channel_id = 7
# Activate the slow mode of the bot, 0 = disable, 1 = enable.
# If slow mode is activated, the bot connects slower to the server
# and disables some bot features to reduce the amount of needed commands.
# This feature may allow you to use the bot without whitelist the bot IP address.
# Slow mode disables the bad channel name check, channel notify, client auto move, client database cache,
# server group notify, welcome message and do not allow the bot check interval to be lower than 3 seconds.
bot_slowmode = 0
# Check every X seconds, default is 1. Values between 1 and 30 are allowed.
# If slow mode is activated, 3 is the lowest possible value.
bot_check_interval = 1
# A different encoding of the messages config files.
# Default is UTF-8 which should be good for all EU and US languages.
# Change this only if you know what you are doing!
# For English or German language you can also use the encoding ISO-8859-1
# A list of all valid ones: http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
bot_messages_encoding = UTF-8
# This enables the client database list cache. This cache is needed for commands like !lastseen. 1 = Enable, 0 = Disable
bot_clientdblist_cache = 1
# This enables the global message variables. See readme file for a list of variables. 1 = Enable, 0 = Disable
# If enabled, you can use all server variables in all messages. If not needed, disable this to save performance.
bot_global_message_vars = 0
# Server Query name, this will be displayed as name of the connection.
bot_server_query_name = Bot
# Second Server Query name, this will be displayed as name of the connection.
# This name will be used, if the first name is already in use.
bot_server_query_name_2 = Bot1
# Change the date pattern, which will be used to format a date in chat functions and welcome message.
# To get help how to make such a pattern, look here: http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
bot_date_pattern = dd.MM.yyyy HH:mm:ss
# Should the bot try to connect forever if the Teamspeak server or the bot is offline? 0 = disable, 1 = enable
bot_connect_forever = 1
# Every time a bot full admin connects to the TS3 server it will be checked if an update for the JTS3ServerMod is available.
# If an update is available, a chat message will be sent to the bot full admin.
# 0 = disable, 1 = final versions, 2 = final and test versions
bot_update_check = 1
# Minimum log level, how much details you want to be written to the bot log files? Default is 1.
# Higher log levels will be also written, as an example: You set log level to 2, level 2, 3 and critical errors will be written to bot log file.
# 0 = Debug
# 1 = Information (recommended and default)
# 2 = Warning (recommended for smaller log files)
# 3 = Error (experts only)
bot_log_level = 1
# A comma separated list (without spaces) of unique user ids, which should be able to use bot admin commands.
# The unique user ids looks like this: mBbHRXwDAG7R19Rv3PorhMwbZW4=
bot_admin_list = xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=,xxx=
# User1,User2,user3,user4,user5, user6,user7,user8,user9,user10,user11, user12, user13

# Set a comma separated list (without spaces) of needed bot functions here.
# Each function needs the function class and the function name, both separated with a colon.
# All possible function classes are listed below, that class is case sensitive!
# That function name you choose is important and has to be unique. It will be used as prefix for the configuration key names and chat commands.
# Don't use spaces in the function names, only use letters, numbers, minus and underscore!
# Most functions allow multiple usage, that allows you to set as many welcome messages or idle check rules, as you want.
# Don't forget that you have to put all settings of the functions in this file.
# Hint: Start the bot with the argument -updateconfig after adding bot functions, that writes the configuration for all functions into this file!
# Whole command: java -jar JTS3ServerMod.jar -updateconfig
# Notice: This -updateconfig will also delete all lines of removed or renamed functions in this config file!
# For more information about the functions read documents/ConfigHelp.html or documents/ConfigHelp_deutsch.html!
# Example: IdleCheck:idle,IdleCheck:idle_guest,MuteMover:mute,WelcomeMessage:welcome,WelcomeMessage:welcome_guest
# This example gives you the following:
# - Two IdleCheck with the name idle and idle_guest
# - One MuteMover with the name mute
# - Two WelcomeMessage with the name welcome and welcome_guest
#
# Function list (use only once!):
# AutoMove - Move connecting clients of a specified server group to a specified channel
# LastSeen - Chat command to check the last online time of a client (client database list cache must be enabled!)
#
# Function list (multiple use possible):
# Advertising - Send messages to channel or server chat every X minutes
# AwayMover - Move the client as soon as away status is set for longer than X seconds
# BadChannelNameCheck - Checking for bad channel names, can delete the channel and punish the client
# BadNicknameCheck - Checking for bad nicknames and can punish the client
# ChannelNotify - Notify specified server groups about clients joining a specified channel
# IdleCheck - Move or kick an idle client, can also send an idle warning message
# InactiveChannelCheck - Delete channels if empty for more than X hours
# MuteMover - Move the client as soon as the specified mute status is set for longer than X seconds
# RecordCheck - Move or kick a recording client (of course only the record function of the Teamspeak client is detected)
# ServerGroupNotify - Notify specified server groups about clients of specified server groups connecting to the TS3 server
# ServerGroupProtection - Make sure that only specified clients are members of the specified server groups
# WelcomeMessage - Sends a message to new connected clients
bot_functions = IdleCheck:idle
# Set a comma separated list (without spaces) of needed but disabled bot functions here.
# Same format as bot_functions!
# All functions you set here are not activated at bot start, but you can switch on functions using chat commands.
bot_functions_disabled =


# Select the action if a client is idle for more than the specified maximum time, possible values: kick and move
idle_action = move
# If clients got moved, move client back if not idle anymore? Set yes or no here!
idle_moveback = yes
# If clients should be moved, set channel id to move idle clients into it.
idle_channel_id = 26
# A comma separated list (without spaces) of channel ids.
# Depends on the given mode, this channels can be ignored or only this channels will be checked!
# If no channels should be ignored, set no channels here and select the channel list mode ignore!
idle_channel_list = 26,10,11,4,3,186,187,188,189,190,191,192
# Select one of the two modes for the channel list.
# ignore = The selected channels will be ignored.
# only = Only the selected channels will be checked.
idle_channel_list_mode = ignore
# A comma separated list (without spaces) of server group ids.
# Depends on the given mode, this server groups can be ignored or only this server groups will be checked!
# If no server groups should be ignored, set no server groups here and select the group list mode ignore!
idle_group_list = 7,14,13,86
# Select one of the two modes for the server group list.
# ignore = The selected server groups will be ignored.
# only = Only the selected server groups will be checked.
idle_group_list_mode = only
# Set the max idle time in minutes.
# If clients should be kicked, the client will be kicked after being idle for this time.
# If clients should be moved, the client will be moved to specified channel after being idle for this time!
idle_max_time = 30
# If clients should be moved, set the max idle time in minutes to kick someone.
# Has to be greater than idle_max_time or -1 to disable this feature!
idle_second_max_time = -1
# Set the idle warn time in minutes or set -1 to disable this feature.
# The idle warn time has to be smaller than the max idle time
idle_warn_time = 25
# A minimum client count to activate the idle check (Query clients are not counted).
# If less clients are in the channel or on the server, idle check does nothing.
idle_min_clients = 2
# Select if the minimum client count is needed in the channel or on the server.
# channel or server are valid values!
idle_min_clients_mode = server
# If clients should be moved, select the message mode, how the client should get the message.
# poke, chat or none are valid values!
idle_message_mode = chat
# Select the message mode, how the client should get the message.
# poke or chat are valid values!
idle_warn_message_mode = chat
# Path to file which contains the idle messages
idle_file = config/server1/idlemessages.cfg



C:\Stuff\Teamspeak\JTS3ServerMod\config\server1\idlemessages.cfg
# JTS3ServerMod Config File
# Idle message, the client get this message as kick reason (on kick) or chat message (on move).
# You can use the following keywords, which will be replaced:
# %IDLE_MAX_TIME% - Replaced with max idle time
# %IDLE_CHANNEL_NAME% - After moving client this will be replaced with the channel name
# Typical BBCode like in Teamspeak 3 Client possible. You can use \n for a new line.
# Use the character sequence §+§ to split a long message into multiple messages.
%IDLE_MAX_TIME% max AFK time.

# If move is enabled, set the kick reason for being idle longer than second max idle time.
# You can use the following keywords, which will be replaced:
# %IDLE_MAX_TIME% - Replaced with max idle time
# %IDLE_SECOND_MAX_TIME% - This will be replaced with the second idle max time
# Typical BBCode like in Teamspeak 3 Client possible. You can use \n for a new line.
# Use the character sequence §+§ to split a long message into multiple messages.
You got kicked because being idle for longer than %IDLE_SECOND_MAX_TIME% minutes.

# Idle warning message, the client get this message as chat message.
# You can use the following keywords, which will be replaced:
# %IDLE_WARN_TIME% - Replaced with idle warn time
# %IDLE_MAX_TIME% - Replaced with max idle time
# %IDLE_CHANNEL_NAME% - After moving client this will be replaced with the channel name
# Typical BBCode like in Teamspeak 3 Client possible. You can use \n for a new line.
# Use the character sequence §+§ to split a long message into multiple messages.
%IDLE_WARN_TIME% AFK. In 5 Minuten wirst du verschoben nach "%IDLE_CHANNEL_NAME%"!

Stefan1200

Siehe changelog.txt
QuotePath values can contain now the variable %apphome% which will be replaced with the environment variable app.home.
  app.home will be set while starting the JTS3ServerMod as a Windows service created by my script.
  But you can also set this app.home variable while adding the argument -Dapp.home=PATH_TO_JTS3SERVERMOD while starting the JTS3ServerMod.
  If no app.home environment variable exists, it will be replaced with an empty string.

Wenn du also das %apphome% Schlüsselwort am Anfang jedes relativen Pfades belässt, wie es in der Standard Konfiguration ist, dann sollte es funktionieren.

Auch in der InstallWindowsService.cmd muss nichts geändert werden.

Naishweb

Ach Stefan, wenns dich nicht geben würde! 8)

Edit
Stefan hat natürlich wieder den Nagel auf den Kopf getroffen:
in der JTS3ServerMod_server.cfg den Pfadeintrag von
idle_file = config/server1/idlemessages.cfg
auf
idle_file = %apphome%/config/server1/idlemessages.cfg
geändert und schwupps da isses wieder :-)
/Edit

Zur Analyse des DAUs:
Meine Config ist uralt. Hab den Changelogeintrag ganz gelinde ignoriert. Schande über mein Haupt!

Stefan1200

Quote from: Naishweb on March 15, 2016, 08:01:20 AM
Meine Config ist uralt. Hab den Changelogeintrag ganz gelinde ignoriert. Schande über mein Haupt!

Da ist es auch recht einfach zu übersehen. Glaube aber das noch woanders dokumentiert zu haben, bin mir aber nicht sicher. Es ist auch noch in der readme unter "Allgemeine Informationen zur Installation und Benutzung" beschrieben.

Zum JTS3ServerMod gibt es halt so wahnsinnig viel zu dokumentieren, das ist der pure Wahnsinn. 50-60% der Zeit, an dem ich am JTS3ServerMod gearbeitet habe, ist nur für die Dokumentation (inklusive Changelog) drauf gegangen. Das muss man mal über die 6 Jahre zusammen rechnen ;)