So I'm quite new to linux but I'm starting to understand it. I have a Ubuntu Server 12.04 system, fresh install, and I installed a teamspeak 3 server on it:
$ sudo useradd teamspeak
(provided user info and password)
$ su teamspeak
(entered password)
$ cd /home/teamspeak
$ wget http://ftp.4players.de/pub/hosted/ts3/releases/3.0.10.3/teamspeak3-server_linux-amd64-3.0.10.3.tar.gz
(download teamspeak.tar.gz)
$ tar -zxvf teamspeak3-server_linux-amd64-3.0.10.3.tar.gz
(unpacked the file to teamspeak3-server_linux-amd64)
$ mv teamspeak3-server_linux-amd64 server
(server is no located in /home/teamspeak/server)
$ cd ./server
$ ./ts3server_minimal_runscript.sh createinifile=1
(initialized the server)
$ ./ts3server_startscript.sh start
(started the server)
Now when I reboot my server (e.g. $ sudo reboot
) the server doesn't start up. Obviously because I haven't configured anything in /etc/init.d
but I have no idea how to do this.
I want the server to start like it does with the /home/teamspeak/server/ts3server_startscript.sh start
script, ran by the user teamspeak
.
I followed several guides but they didn't work. Can someone help me?
I recommend creating an Upstart script.
First you want to create the script itself: sudo nano /etc/init/ts-server.conf
Copy and paste this skeleton and make any changes you need:
# description "start and stop the TS server"
console log # Log events to console
exec start-stop-daemon --start --chdir /home/teamspeak/server/ --chuid teamspeak \
--exec /home/teamspeak/server/ts3server_startscript.sh start
start on runlevel [2345] # Tell when to start
stop on runlevel [^2345] # Tell when to stop
respawn # Block excess respawn
respawn limit 20 5 # Ditto
Save that file, go to /home/teamspeak/server/
and create a file ts3server_upstart.sh
Contents:
#!/bin/bash
/home/teamspeak/server/ts3server_startscript.sh start
Save, mark it as execuatable, done! It'll start on boot, and can be manually started/stopped/restarted using sudo service ts-server start
, sudo service ts-server stop
, and sudo service ts-server restart
, respectively.
EDIT: This may not actually STOP TeamSpeak. I do not know enough about TS and starting to tell you whether it will or will not.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다