Autostart Ts3 Sever Ubuntu 12.10

Witam przeszukałem internet przeczytałem wiele artykułów na temat możliwości auto startu w linuxach ale nie chce to jakoś działa więc co osiągnąłem.

Trochę info:

 

  • Ścieżka do plików serwerowych ts3

/ts3

 

  • Użytkownicy

root

 

  • Plik rozruchowy (auto startujący stworzony przy użyciu jakiegoś poradnika)

/etc/init.d/ts3

#!/bin/sh
# chkconfig: 2345 99 10
# Skryptu autostartu TeamSpeak 3
USER="root"
TS3='/ts3'
STARTSCRIPT="$TS3/ts3server_startscript.sh"
cd $TS3
case "$1" in
'start')
su $USER -c "$STARTSCRIPT start"
;;
'stop')
su $USER -c "$STARTSCRIPT stop"
;;
'restart')
su $USER -c "$STARTSCRIPT restart"
;;
'status')
su $USER -c "$STARTSCRIPT status"
;;
*)
echo "Usage $0 start|stop|restart|status"
esac
  • chkconfig

    apparmor on
    atd off
    bootlogd off
    console-font off
    console-setup off
    cron off
    dbus off
    dmesg off
    dns-clean on
    friendly-recovery off
    grub-common on
    hostname off
    hwclock off
    hwclock-save off
    irqbalance off
    killprocs on
    module-init-tools off
    network-interface off
    network-interface-container off
    network-interface-security off
    networking off
    networking.dpkg-new off
    ondemand on
    passwd off
    plymouth off
    plymouth-log off
    plymouth-splash off
    plymouth-stop off
    plymouth-upstart-bridge off
    pppd-dns on
    procps off
    rc.local on
    rcS off
    resolvconf off
    rsync on
    rsyslog off
    screen-cleanup off
    sendsigs 0
    setvtrgb off
    ssh off
    stop-bootlogd off
    stop-bootlogd-single off
    sudo on
    ts3 off
    udev off
    udev-fallback-graphics off
    udev-finish off
    udevmonitor off
    udevtrigger off
    ufw off
    umountfs 0
    umountnfs.sh 0
    umountroot 0
    unattended-upgrades off
    urandom 0S

No i tu jest problem niestety nie potrafię tego uruchomić, liczę na bardziej zaawansowanych użytkowników, którzy mogli by pomóc.

 

Uruchamianie ts jako root to fatalny pomysł. Rozpakuj sobie pliki serwera w katalogu użytkownika i dodaj polecenie uruchamiające do /etc/rc.local z prawami użytkownika

#!/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.

exit 0

mógłbyś mi może pomóc jakie to polecenie i gdzie je mam dodać 

 

zrobiłem tak:

#!/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.
sudo -u teamspeaker /ts3/ts3server_startscript.sh start
exit 0

Nie działa

su -l teamspeaker -c "/ts3/ts3server_startscript.sh start"

dodałem tą komendę przed exit 0 niestety nie działa jednak jak wpisuję komendę

 

#/ts3/ts3server_startscript.sh start

 

to ts się uruchamia co mogę zrobić jeszcze

Wklej wynik

ls -l /ts3/
-rw-r--r-- 1 root root 41908 mar 22 15:08 CHANGELOG
-rw-r--r-- 1 root root 9222 mar 22 17:09 chkconfig_11.0-79.1-2_all.deb
drwxr-xr-x 2 root root 4096 mar 22 15:08 doc
drwxr-xr-x 4 root root 4096 mar 22 15:08 files
-rw-r--r-- 1 root root 733144 mar 22 15:08 libts3db_mysql.so
-rw-r--r-- 1 root root 1369112 mar 22 15:08 libts3db_sqlite3.so
-rw-r--r-- 1 root root 23854 mar 22 15:08 LICENSE
drwxr-xr-x 2 root root 4096 mar 23 01:40 logs
-rw-r--r-- 1 root root 1 mar 22 15:08 query_ip_blacklist.txt
-rw-r--r-- 1 root root 10 mar 22 15:08 query_ip_whitelist.txt
drwxr-xr-x 2 root root 4096 mar 22 15:08 redistributables
drwxr-xr-x 2 root root 4096 mar 22 15:08 serverquerydocs
drwxr-xr-x 4 root root 4096 mar 22 15:08 sql
-rwxr--r-- 1 root root 7215432 mar 22 15:08 ts3server_linux_x86
-rwxr-xr-x 1 root root 1192 mar 22 15:08 ts3server_minimal_runscript.sh
-rw-r--r-- 1 root root 4 mar 23 01:40 ts3server.pid
-rw-r--r-- 1 root root 295936 mar 23 01:40 ts3server.sqlitedb
-rwxrwxrwx 1 root root 3728 mar 22 15:08 ts3server_startscript.sh
drwxr-xr-x 2 root root 4096 mar 22 15:08 tsdns

zauważyłem że na tej liście prawa do plików ma tylko root i komendę ustawiłem

su -l root -c “/ts3/ts3server_startscript.sh start”

i już się włącza dziękuję :wink:

Proszę korzystać z przycisku Edytuj , zamiast pisać post pod postem.

rgabrysiak

I bardzo źle, bo przez to znowu wróciłeś do pkt wyjścia i uruchamiasz serwer TS jako root.

 

Najpierw przywróć uprawnienia do plików dla użytkownika teamspeaker poleceniem

chown -R teamspeaker:teamspeaker /ts3

a potem popraw ponownie linijkę w rc.local na

su -l teamspeaker -c "/ts3/ts3server_startscript.sh start"

Ale nie mam użytkownika teamspeaker ewnetualnia mam jeszcze użytkownika mateusz czy może być on ?

To skąd wziąłeś wcześniej linijkę

sudo -u teamspeaker /ts3/ts3server_startscript.sh start

?

 

Może być mateusz, wystarczy jak podmienisz “teamspeaker” na “mateusz” w kodzie z mojego poprzedniego posta.