Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 13 of 13
  1. #1
    Join Date
    April 2013
    Posts
    19

    Generate files (ts3server.sqlitedb, ts3server.pid, logs/*, files/*) to another folder

    OK, I am packaging the TeamSpeak 3 server (following the terms stated in this thread by Peter) for Ubuntu and I ran into a hiccup. On upgrading it completely uninstalls the deb and installs the new version. Because of this it deletes the databases. Is there a way I can re-direct all generated files, like the sqlitedb and 'files' folder, to a different folder? Or will I have to wait for them to start & stop it for the first time, then move and symlink them?

  2. #2
    Join Date
    December 2004
    Location
    RF
    Posts
    3,008
    Let me ask a question - WHY THE HELL you packaging a database with it?
    Answer it and you'll have the answer to your own questions.

  3. #3
    Join Date
    April 2013
    Posts
    19
    Quote Originally Posted by ANR Daemon View Post
    WHY THE HELL you packaging a database with it?
    Because I'm not.

    Quote Originally Posted by twprogrammers
    re-direct all generated files, like the sqlitedb and 'files' folder, to a different folder
    Quote Originally Posted by twprogrammers
    Because of this it deletes the databases
    Code:
    # ls /opt/ts3/server
    CHANGELOG            LICENSE           ts3server_linux_amd64
    doc                  redistributables  ts3server_minimal_runscript.sh
    libts3db_mysql.so    serverquerydocs   ts3server_startscript.sh
    libts3db_sqlite3.so  sql               tsdns
    # service ts3-server start
    Starting the TeamSpeak 3 server
    TeamSpeak 3 server started, for details please view the log file
    ------------------------------------------------------------------
                          I M P O R T A N T
    ------------------------------------------------------------------
                   Server Query Admin Account created
             loginname= "serveradmin", password= "niJILH8C"
    ------------------------------------------------------------------
    
    
    ------------------------------------------------------------------
                          I M P O R T A N T
    ------------------------------------------------------------------
          ServerAdmin privilege key created, please use it to gain
          serveradmin rights for your virtualserver. please
          also check the doc/privilegekey_guide.txt for details.
    
           token=JfZXDUq8fv2Hbm4dcFL8rx93KleLH4xg58EX1RZH
    ------------------------------------------------------------------
    # ls /opt/ts3/server
    CHANGELOG            query_ip_blacklist.txt  ts3server_minimal_runscript.sh
    doc                  query_ip_whitelist.txt  ts3server.pid
    files                redistributables        ts3server.sqlitedb
    libts3db_mysql.so    serverquerydocs         ts3server_startscript.sh
    libts3db_sqlite3.so  sql                     tsdns
    LICENSE              start.sh
    logs                 ts3server_linux_amd64
    # service ts3-server stop
    Stopping the TeamSpeak 3 server..done
    # ls /opt/ts3/server
    CHANGELOG            logs                    start.sh
    doc                  query_ip_blacklist.txt  ts3server_linux_amd64
    files                query_ip_whitelist.txt  ts3server_minimal_runscript.sh
    libts3db_mysql.so    redistributables        ts3server.sqlitedb
    libts3db_sqlite3.so  serverquerydocs         ts3server_startscript.sh
    LICENSE              sql                     tsdns
    So when I update the deb and do an upgrade I get this:
    Code:
    # ls /opt/ts3/server
    CHANGELOG            LICENSE           ts3server_linux_amd64
    doc                  redistributables  ts3server_minimal_runscript.sh
    libts3db_mysql.so    serverquerydocs   ts3server_startscript.sh
    libts3db_sqlite3.so  sql               tsdns
    This was quite deflating.

  4. #4
    Join Date
    December 2004
    Location
    RF
    Posts
    3,008
    Then you're doing something wrong.

  5. #5
    Join Date
    April 2013
    Posts
    19
    Quote Originally Posted by ANR Daemon View Post
    Then you're doing something wrong.
    You think?

  6. #6
    Join Date
    December 2004
    Location
    RF
    Posts
    3,008
    100%. To begin with, I'm not sure if you have rights to redistribute modified copies of original installation archives.

  7. #7
    Join Date
    February 2012
    Location
    Germany
    Posts
    577
    I once did a package for *.rpm (and because of the license I only published the *.spec file so everyone has to create the *.rpm himself), and I distributed the files this way:

    /etc/ld.so.conf.d/teamspeak3-server-x86_64.conf
    /etc/logrotate.d/teamspeak3-server
    /etc/rc.d/init.d/teamspeak3
    /etc/rc.d/init.d/tsdnsserver
    /etc/teamspeak3
    /etc/teamspeak3/query_ip_blacklist.txt
    /etc/teamspeak3/query_ip_whitelist.txt
    /etc/teamspeak3/ts3server.ini
    /etc/teamspeak3/tsdns_settings.ini
    /usr/bin/ts3server_linux_amd64
    /usr/bin/tsdnsserver_linux_amd64
    /usr/lib64/teamspeak3-server
    /usr/lib64/teamspeak3-server/libts3db_sqlite3.so
    /usr/share/doc/teamspeak3-server-3.0.10.3
    /usr/share/doc/teamspeak3-server-3.0.10.3/CHANGELOG
    /usr/share/doc/teamspeak3-server-3.0.10.3/LICENSE
    /usr/share/doc/teamspeak3-server-3.0.10.3/README.install
    /usr/share/doc/teamspeak3-server-3.0.10.3/doc
    /usr/share/doc/teamspeak3-server-3.0.10.3/doc/permissiondoc.txt
    /usr/share/doc/teamspeak3-server-3.0.10.3/doc/privilegekey_guide.txt
    /usr/share/doc/teamspeak3-server-3.0.10.3/doc/server_quickstart.txt
    /usr/share/doc/teamspeak3-server-3.0.10.3/doc/server_upgrade.txt
    /usr/share/doc/teamspeak3-server-3.0.10.3/doc/ts3_serverquery_manual.pdf
    /usr/share/doc/teamspeak3-server-3.0.10.3/tsdns
    /usr/share/doc/teamspeak3-server-3.0.10.3/tsdns/README
    /usr/share/doc/teamspeak3-server-3.0.10.3/tsdns/USAGE
    /usr/share/doc/teamspeak3-server-3.0.10.3/tsdns/tsdns_settings.ini.sample
    /usr/share/teamspeak3-server
    /usr/share/teamspeak3-server/serverquerydocs
    /usr/share/teamspeak3-server/serverquerydocs/*.txt
    /usr/share/teamspeak3-server/sql
    /usr/share/teamspeak3-server/sql/*.sql
    /usr/share/teamspeak3-server/sql/create_mysql
    /usr/share/teamspeak3-server/sql/create_mysql/*.sql
    /usr/share/teamspeak3-server/sql/create_sqlite
    /usr/share/teamspeak3-server/sql/create_sqlite/*.sql
    /var/lib/teamspeak3
    /var/lib/teamspeak3/serverquerydocs -> /usr/share/teamspeak3-server/serverquerydocs (symbolic link)
    /var/log/teamspeak3
    /var/run/teamspeak3

    The database is created in /var/lib/teamspeak3. The self-made start script does a cd into that directory before starting the server. The directory is owned by the Teamspeak rpm package, but rpm doesn't remove it on uninstall if it contains files unrelated to the package. I'm quite sure you can achieve the same behaviour for the Ubuntu packaging system for a package-owned directory. Log files go to /var/log/teamspeak3 (via *.ini file). The *.so is put into an extra directory under lib64 and ldconfig is used to make it known, so no LD_LIBRARY_PATH fiddling is necessary in the startscript.

  8. #8
    Join Date
    December 2004
    Location
    RF
    Posts
    3,008
    If I were you, I'd make a package, that would download the dist from TS own servers, and shuffle it's files around in the system, as it pleased.

  9. #9
    Join Date
    February 2012
    Location
    Germany
    Posts
    577
    That way the shuffled-around files will not belong to the package. The files cannot be managed by the packaging system, such as setting proper ownership and permissions, clean up after update or deinstallation, and verification of package consistency (md5 check of file contents and so). You can of course do all this in pre- and post-install scriptlets, but for what do we have a sophisticated packaging system, if we do it all manually in scriptlets in the end?

    No, either you create an ordinary package or no package at all.

    For the second variant (no package at all) install- and update scripts already exist that download the source package and installs/updates a running server mostly automatic.

  10. #10
    Join Date
    December 2004
    Location
    RF
    Posts
    3,008
    That's not quite true.
    Every package management system has the concept of "hooks": postinstall, uninstall, etc.
    You just write a hook, that cleanup the mess when package is uninstalled.

  11. #11
    Join Date
    February 2012
    Location
    Germany
    Posts
    577
    That's what I meant with "scriptlets".

    Read: "For what do we have a sophisticated packaging system, if we do it all manually in hooks in the end?"

  12. #12
    Join Date
    December 2004
    Location
    RF
    Posts
    3,008
    You seems to have a misconception about hooks and packaging systems in general.

  13. #13
    Join Date
    September 2012
    Posts
    6,079
    to simply answer the original question:
    you can redirect the logs folder as well as the sql folder with command line parameters when launching the server, but you cannot divert the files folder or the database. The pid file could be created at a different location, however you'd need to modify the startscript for that.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ts3server.sqlitedb
    By lorheak in forum Server Support
    Replies: 2
    Last Post: September 7th, 2013, 09:08 PM
  2. ts3server.sqlitedb buggy
    By LincolnJunnior in forum Server Support
    Replies: 1
    Last Post: March 25th, 2013, 12:33 PM
  3. [No Bug] rm'ing ts3server.sqlitedb to hardreset a server?
    By Gallandor in forum Linux / FreeBSD
    Replies: 2
    Last Post: February 2nd, 2011, 12:40 PM
  4. Editing ts3server.sqlitedb
    By ivich in forum General Questions
    Replies: 4
    Last Post: April 10th, 2010, 02:55 PM
  5. File ts3server.sqlitedb
    By ccasonato in forum Windows
    Replies: 3
    Last Post: January 28th, 2010, 01:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •