Community Forums Today's Posts     Member List     Archive    
Results 1 to 15 of 15
  1. #1
    Join Date
    Jun 2007
    Location
    USA
    Posts
    17

    Solved [solved] launchd and Teamspeak 3 - SUCCESS

    I've seen several people asking about it, but no successful posts about using launchd to start the Teamspeak 3 server, so here's what is working for me.

    Notes:
    • Change the UserName key to the account name of the user you want it to run as. There's no reason to run it as root -- just don't do it!
    • Set WorkingDirectory to the path of the server binary.
    • I have KeepAlive set to false. I prefer to do it this way for testing, so launchd won't keep trying to launch the server every 10 seconds forever if something isn't working. Once all is working as intended, you might consider changing this to TRUE, so launchd will restart the process if it dies (or is killed).
    • I recommend Lingon to add this to your user daemons. Put it in expert mode, paste in the plist below, make the changes I mentioned above, and save. Done!


    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>KeepAlive</key>
    	<false/>
    	<key>Label</key>
    	<string>net.MyDaemons.TeamSpeak3</string>
    	<key>ProgramArguments</key>
    	<array>
    		<string>./ts3server_mac</string>
    	</array>
    	<key>RunAtLoad</key>
    	<true/>
    	<key>UserName</key>
    	<string>MacUser</string>
    	<key>WorkingDirectory</key>
    	<string>/Users/MacUser/ts3/</string>
    </dict>
    </plist>

  2. #2
    Join Date
    Feb 2008
    Location
    NYC
    Posts
    35
    This does not work on Mac OS X Server. It will not run as a daemon.

  3. #3
    Join Date
    Jun 2007
    Location
    USA
    Posts
    17
    Could you be more specific? How, exactly, does it fail to run as a daemon? Error messages, etc. Maybe you could post the bit of your console log that launchd and/or TS3 creates when trying to launch TS3 on Mac OS X server using the plist I posted? That might be helpful.

    The key bits that I've seen missing from other posts on the subject are the WorkingDirectory key (critical!) and the UserName key. (TS3 runs fine as root, but of course, you shouldn't run anything as root unless you really, really have to.)

    I've not tried it on Mac OS X server, but I don't know why launchd would behave any differently on the server than it does on the normal version. Will TS3 run when manually launched on Mac OS X Server? (i.e., cd to directory and ./ts3server_mac)

    Unfortunately, I don't have a version of Server to test any of this with, but I can say with certainty that the above works fine on Mac OS X 10.6.3, non-server version. I can even kill the ts3server process and launchd will re-launch it. (w/ KeepAlive=true)

  4. #4
    Join Date
    Jun 2007
    Location
    USA
    Posts
    17
    Sorry, I just saw that you've already posted a lot of what I requested in your other thread. Looking that over, it seems that the most important part you're missing is:

    <key>WorkingDirectory</key>
    <string>/Users/MacUser/ts3/</string>

    If you add that (and of course, change the path to where you have TS3 installed), does it work then?

  5. #5
    Join Date
    Feb 2008
    Location
    NYC
    Posts
    35
    It fails with that addition.

    Code:
    6/16/10 8:21:18 PM	net.100greenwood.TeamSpeak3[103]	TeamSpeak Server 3.0.0-beta23 [Build: 11239]
    6/16/10 8:21:18 PM	net.100greenwood.TeamSpeak3[103]	(c)TeamSpeak Systems GmbH
    6/16/10 8:21:18 PM	net.100greenwood.TeamSpeak3[103]	Logging started
    6/16/10 8:21:18 PM	net.100greenwood.TeamSpeak3[103]	2010-06-17 00:21:18.793580|INFO    |ServerLibPriv |   | Server Version: 3.0.0-beta23 [Build: 11239], MacOSX
    6/16/10 8:21:18 PM	net.100greenwood.TeamSpeak3[103]	2010-06-17 00:21:18.793948|CRITICAL|DatabaseQuery |   | unable to load database plugin library "libts3db_sqlite3.dylib", halting!
    6/16/10 8:21:18 PM	com.apple.launchd[1]	(net.100greenwood.TeamSpeak3[103]) Exited with exit code: 1
    My launchd file looks like this:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>KeepAlive</key>
    	<false/>
    	<key>Label</key>
    	<string>net.100greenwood.TeamSpeak3</string>
    	<key>ProgramArguments</key>
    	<array>
    		<string>/Users/serveradmin/Desktop/teamspeak3-server_mac/ts3server_mac</string>
    	</array>
    	<key>RunAtLoad</key>
    	<true/>
    	<key>WorkingDirectory</key>
    	<string>/Users/serveradmin/Desktop/teamspeak3-server_mac/ts3server_mac</string>
    </dict>
    </plist>
    For whatever reason it won't load the "libts3db_sqlite3.dylib" library. Same error each time.

  6. #6
    Join Date
    Feb 2008
    Location
    NYC
    Posts
    35
    Fixed it with your help. I am replying to my original thread with the entire solution.

    Thanks for the lead, it definitely helped!

  7. #7
    Join Date
    Feb 2006
    Location
    Brasil
    Posts
    23
    Hey guys, I have this plist file checked and rechecked like 10 times and it's all ok.
    I'm on a local area network, and my TS wont connect even to the direct IP adress of the server.
    Only if I log into the server and then start TS Server manually trough the server's terminal.

    When launchd works successfully, what's the TS process name (in Activity monitor) so I can check if mine is ok for now?
    Thanks!

  8. #8
    Join Date
    Feb 2008
    Location
    NYC
    Posts
    35
    Can you post the files you are using with TS? .plists and the .ini file.

  9. #9
    Join Date
    Jun 2011
    Posts
    6
    can someone help me I have an activation key, non-profit and I can not turn the problem on the mac on the Mac is here 'cause I work on windows !!!!! the key that I received and I copy it on licenze.dat given directory server then restart the server but when I increased from 32 to 500 slots tells me error The terminal report: 2011-06-24 08:37:36.106956|WARNING |Accounting | | Unable to find valid license key, falling back to limited functionality

  10. #10
    Join Date
    Feb 2006
    Location
    Brasil
    Posts
    23
    Quote Originally Posted by tmm4264 View Post
    Can you post the files you are using with TS? .plists and the .ini file.
    I copied your text from this post to textedit.app, made the referred changes in this thread, saved as rtf then renamed the file to plist, then finally moved it to the folder [hard-disk]/Library/LaunchDaemons/.
    The thing is: nothing starts. No errors, nothing on logs, it's like my plist doesn't exist at all.

    Here is the final plist of mine:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>KeepAlive</key>
    	<false/>
    	<key>Label</key>
    	<string>local.TS3</string>
    	<key>Program</key>
    	<array>
    		<string>/Users/teamspeak/Desktop/teamspeak3-server_mac/ts3server_mac</string>
    	</array>
    	<key>ProgramArguments</key>
    	<array>
    		<string>/Users/teamspeak/Desktop/teamspeak3-server_mac/ts3server_mac</string>
    		<string>inifile=ts3server.ini</string>
    	</array>
    	<key>UserName</key>
    	<string>teamspeak</string>
    	<key>WorkingDirectory</key>
    	<string>/Users/teamspeak/Desktop/teamspeak3-server_mac/</string>
    	<key>RunAtLoad</key>
    	<true/>
    </dict>
    </plist>
    And here is my .ini file:
    Code:
    machine_id=
    default_voice_port=9987
    voice_ip=0.0.0.0
    liscensepath=
    filetransfer_port=30033
    filetransfer_ip=0.0.0.0
    query_port=10011
    query_ip=0.0.0.0
    dbplugin=ts3db_sqlite3
    dbpluginparameter=
    dbsqlpath=sql/
    dbsqlcreatepath=create_sqlite/
    logpath=logs
    logquerycommands=1
    Thanks for the help!

  11. #11
    Join Date
    Feb 2006
    Location
    Brasil
    Posts
    23
    I just noticed that my plist file is from a different thread than this one.
    So I tried again with the same plist as this thread's first post.
    Still nothing on the logs, nothing hapens.
    Looks like this:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>KeepAlive</key>
    	<false/>
    	<key>Label</key>
    	<string>local.TS3</string>
    	<key>ProgramArguments</key>
    	<array>
    		<string>./ts3server_mac</string>
    	</array>
    	<key>RunAtLoad</key>
    	<true/>
    	<key>UserName</key>
    	<string>teamspeak</string>
    	<key>WorkingDirectory</key>
    	<string>/Users/teamspeak/Desktop/teamspeak3-server_mac/</string>
    </dict>
    </plist>
    I even thought it could be because of password, so I changed teamspeak account password to nothing, and still no difference, nothing hapens.

    Now for the last idea I have, tried to run as root, to see if there was any user-thing blocking, but still the same "nothing" hapened.
    So i'm sure the problem is related to the plist file.
    Did I create it in the right way?


    P.S.: When I log in the computer and open TS manually from the terminal, it runs OK, just the right way it should.

  12. #12
    Join Date
    Feb 2008
    Location
    NYC
    Posts
    35
    Save it as a Plain Text file, not an RTF. The encoding for an RTF makes the file illegible for TS Server and it subsequently won't run.

    You can also copy and paste the file into pico (a Terminal text editor) and save the file.

  13. #13
    Join Date
    Feb 2006
    Location
    Brasil
    Posts
    23
    Changed to Plain Text, still no connections, nothing happens.
    If I go to screen sharing, open terminal and start TS3 Server manually, works ok.
    Is there any log I can open to see what is happening?

    [EDIT]
    Just tried ALSO to put on my old computer, non-server OS:
    Mac Mini with OS 10.6.8, no display, no Keyboard, no mouse,
    Auto-login set to my personal user, ini file is the same plain text, and here is the new plain text plist file:
    Both files were made with Text Editor in mac os x, I don't want to download a program that I will use only this once.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>KeepAlive</key>
    	<false/>
    	<key>Label</key>
    	<string>local.ts3s</string>
    	<key>ProgramArguments</key>
    	<array>
    		<string>/Applications/TeamSpeak3Server/ts3server_mac</string>
    	</array>
    	<key>RunAtLoad</key>
    	<true/>
    	<key>UserName</key>
    	<string>fernando</string>
    	<key>WorkingDirectory</key>
    	<string>/Applications/TeamSpeak3Server/</string>
    </dict>
    </plist>
    Last edited by Pierobon; 31-05-2012 at 15:54.

  14. #14
    Join Date
    Feb 2006
    Location
    Brasil
    Posts
    23
    Ok, found the mystery.

    *.plist files in /Library/LaunchDaemons folder must be owned by root.
    After setting up everything, open terminal and type: sudo chown root /Library/LaunchDaemons/ts3server.plist
    Reboot, et voila!
    If you don't want to reboot, do terminal command: launchctl load /Library/LaunchDaemons/ts3server.plist et voila!
    Last edited by Pierobon; 03-06-2012 at 19:15.

  15. #15
    Join Date
    Sep 2014
    Posts
    1
    Also make sure you set ownership and permissions on the plist file:
    Code:
    sudo chown root:wheel teamspeak.plist
    sudo chmod 644 teamspeak.plist
    To load the daemon without rebooting you can do this:
    Code:
    sudo launchctl load teamspeak.plist
    If you want to unload it do this:
    Code:
    sudo launchctl unload teamspeak.plist

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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