Forum

Results 1 to 15 of 16

Hybrid View

  1. #1
    Join Date
    June 2007
    Location
    USA
    Posts
    18

    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
    February 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
    June 2007
    Location
    USA
    Posts
    18
    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
    June 2007
    Location
    USA
    Posts
    18
    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
    February 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
    February 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!

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
  •