0

At boot, our server needs to start Teamspeak and a teamspeak bot. The first part works, teamspeak always starts, never an issue. However, the teamspeak bot never starts, nor is the Screen session created.

rc.local file displayed below.

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sleep 2
su teamspeak -c 'screen -d -m -S ts3 /home/teamspeak/teamspeak/ts3server_minimal_runscript.sh inifile=ts3server.ini'
sleep 2
su teamspeak -c 'screen -d -m -S tsbot /usr/bin/java -jar /home/teamspeak/jts3servermod/JTS3ServerMod.jar'
exit 0

As stated, teamspeak starts the way it should, within it's own screen session. The .jar file does not however and the screen session isn't there either.

Can someone tell me where I made a mistake?

  • screen will exit if the command exits. Have you tried to run that java command from a shell interactively? – mvreijn Feb 10 '14 at 10:49

1 Answers1

-1

You shouldn't run scripts like that. I'm not sure what's wrong but I would definitely write an sysv/upstart script to do that. the second answer is what you should use

Community
  • 1
  • 1
ciny
  • 481
  • 3
  • 15