PDA

View Full Version : init.d on CentOS Ent 5


benbur
31-03-2008, 03:46
I looked at the other topic and tried that script but no luck. Any ideas for getting Teamspeak to run on startup with CentOS Enterprise 5? (no X Window System)

benbur
31-03-2008, 04:05
Ok, I'm about to try this. It should work. I just came up with it. Any ideas?

#! /bin/bash
# Starting Teamspeak Server
USER=teamspeak
echo "Starting Teamspeak Server"
sudo -u $USER /home/$USER/tss2_rc2/teamspeak2-server_startscript start

benbur
31-03-2008, 04:12
That didn't work. Also didn't work without USER variable...

benbur
31-03-2008, 05:06
I added the following to the bottom of /etc/rc.local and it still didn't work!

# Starting Teamspeak Server
echo "Teamspeak Server is starting up..."
sudo -u teamspeak /home/teamspeak/tss2_rc2/teamspeak2-server_startscript start

I also tried just plain

/home/teamspeak/tss2_rc2/teamspeak2-server_startscript start

benbur
10-04-2008, 11:07
So here is my current /etc/rc.local file:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/sbin/ethtool -s eth0 speed 10 duplex full autoneg off
/etc/init.d/network restart
ntpdate -b ntp.privatedns.com &

/usr/bin/setterm -blank 0
(sleep 10;/etc/rc.d/init.d/bandmin start)&
rdate -s rdate.cpanel.net&

#--Added by /scripts/securetmp--
/scripts/securetmp --auto

/etc/init.d/ipaliases start

echo "Starting Counter-Strike Source Server"
sudo -u css /home/css/srcds/srcds_run -game cstrike -autoupdate -ip **censored** +maxplayers 8 +map de_aztec > cstrike.log 2>&1 &

echo "Starting Teamspeak Server"
sudo -u teamspeak /home/teamspeak/tss2_rc2/teamspeak2-server_startscript start

and this is the output:
Starting Teamspeak Server
starting the teamspeak2 server
Couldnt find server_linux

Can someone from TeamSpeak please help?

zladuric
10-08-2008, 13:45
For those who run into the same problem:

You should edit this script:

/home/teamspeak/tss2_rc2/teamspeak2-server_startscript

And change the file references to relative paths - there are few files that need to be referenced:
linux_server, server.log and tsserver2.pid
From command line:
vim -c "%s/server_linux/\/home\/teamspeak\/tss2_rc2\/server_linux/g|wq" /home/teamspeak/tss2_rc2/teamspeak2-server_startscript && vim -c "%s/server.log/\/home\/teamspeak\/tss2_rc2\/server.log/g|wq" /home/teamspeak/tss2_rc2/teamspeak2-server_startscript && vim -c "%s/tsserver2.pid/\/home\/teamspeak\/tss2_rc2\/tsserver2.pid/g|wq" /home/teamspeak/tss2_rc2/teamspeak2-server_startscript

all on the single line.

Or just use your favorite editor and add those paths.

Note: This is assuming you're installing teamspeak under "teamspeak" username/account. You may want to change the path to whatever you used.

Katana*GFR*
10-08-2008, 17:29
why a escape character between filepaths? Just wondering, since the paths itself's dont have spaces?