You are not logged in.

#1 2013-12-17 17:26:26

PolishHurricane
Member
Registered: 2011-02-02
Posts: 47

[SOLVED] systemd services, TeamSpeak service

I'm really new to systemd and I'm trying to make my first service, it works for the most part, but I can't seem to get it to load on boot.

[Unit]
Description=Teamspeak Service
Wants=network-online.target

[Service]
WorkingDirectory=/srv/ts3
User=admin
ExecStart=/srv/ts3/ts3server_minimal_runscript.sh
ExecStop=/srv/ts3/ts3server_startscript.sh stop
ExecReload=/srv/ts3/ts3server_startscript.sh restart
Restart=always
RestartSec=15

[Install]
WantedBy=multi-user.target

When I start it manually using "systemctl start teamspeak" or "systemctl restart teamspeak" it works fine, producing this output:

[root@firefly ~]# systemctl start teamspeak
[root@firefly ~]# systemctl -l status teamspeak
teamspeak.service - Teamspeak Service
   Loaded: loaded (/etc/systemd/system/teamspeak.service; enabled)
   Active: active (running) since Tue 2013-12-17 12:15:01 EST; 24s ago
  Process: 309 ExecStop=/srv/ts3/ts3server_startscript.sh stop (code=exited, status=7)
 Main PID: 324 (ts3server_minim)
   CGroup: /system.slice/teamspeak.service
           |-324 /bin/sh /srv/ts3/ts3server_minimal_runscript.sh
           `-333 ./ts3server_linux_amd64

Dec 17 12:15:03 firefly ts3server_minimal_runscript.sh[324]: 2013-12-17 17:15:03.414959|INFO    |CIDRManager   |   | updated query_ip_whitelist ips: 127.0.0.1,
Dec 17 12:15:03 firefly ts3server_minimal_runscript.sh[324]: 2013-12-17 17:15:03.416158|INFO    |Query         |   | listening on 0.0.0.0:10011
Dec 17 12:15:04 firefly ts3server_minimal_runscript.sh[324]: 2013-12-17 17:15:04.028519|INFO    |              |   | License expired, but there is a new one available.. retrieving
Dec 17 12:15:04 firefly ts3server_minimal_runscript.sh[324]: 2013-12-17 17:15:04.246774|INFO    |Accounting    |   | Your license was updated by the licensing server
Dec 17 12:15:04 firefly ts3server_minimal_runscript.sh[324]: 2013-12-17 17:15:04.798725|INFO    |Accounting    |   | Licensing Information
Dec 17 12:15:04 firefly ts3server_minimal_runscript.sh[324]: 2013-12-17 17:15:04.799402|INFO    |Accounting    |   | type              : Non-profit
Dec 17 12:15:04 firefly ts3server_minimal_runscript.sh[324]: 2013-12-17 17:15:04.799796|INFO    |Accounting    |   | starting date     : Mon Jul  1 00:00:00 2013
Dec 17 12:15:04 firefly ts3server_minimal_runscript.sh[324]: 2013-12-17 17:15:04.800142|INFO    |Accounting    |   | ending date       : Wed Jan  8 00:00:00 2014
Dec 17 12:15:04 firefly ts3server_minimal_runscript.sh[324]: 2013-12-17 17:15:04.800458|INFO    |Accounting    |   | max virtualservers: 10
Dec 17 12:15:04 firefly ts3server_minimal_runscript.sh[324]: 2013-12-17 17:15:04.800772|INFO    |Accounting    |   | max slots         : 512
[root@firefly ~]#

However, immediately after boot, this is what I see:

[root@firefly ~]# systemctl -l status teamspeak
teamspeak.service - Teamspeak Service
   Loaded: loaded (/etc/systemd/system/teamspeak.service; enabled)
   Active: active (running) since Tue 2013-12-17 12:19:52 EST; 1min 22s ago
 Main PID: 174 (ts3server_minim)
   CGroup: /system.slice/teamspeak.service
           |-174 /bin/sh /srv/ts3/ts3server_minimal_runscript.sh
           `-197 ./ts3server_linux_amd64

Dec 17 12:19:53 firefly ts3server_minimal_runscript.sh[174]: 2013-12-17 17:19:53                                      .639611|ERROR   |              |   | Could not open default UDP connection for w                                      eblist
Dec 17 12:19:53 firefly ts3server_minimal_runscript.sh[174]: 2013-12-17 17:19:53                                      .691066|INFO    |VirtualServer |  1| listening on 0.0.0.0:9987
Dec 17 12:19:53 firefly ts3server_minimal_runscript.sh[174]: 2013-12-17 17:19:53                                      .692413|INFO    |CIDRManager   |   | updated query_ip_whitelist ips: 127.0.0.1,
Dec 17 12:19:53 firefly ts3server_minimal_runscript.sh[174]: 2013-12-17 17:19:53                                      .693754|INFO    |Query         |   | listening on 0.0.0.0:10011
Dec 17 12:19:53 firefly ts3server_minimal_runscript.sh[174]: 2013-12-17 17:19:53                                      .713940|ERROR   |              |   | TS3ANetwork::ResolveHostName failed error:                                       -2 (Name or service not known) 0
Dec 17 12:19:53 firefly ts3server_minimal_runscript.sh[174]: 2013-12-17 17:19:53                                      .714020|ERROR   |              |   | TS3ANetwork::ResolveHostName failed error:                                       -2 (Name or service not known) 0
Dec 17 12:19:53 firefly ts3server_minimal_runscript.sh[174]: 2013-12-17 17:19:53                                      .714044|ERROR   |              |   | Unable to connect to primary address, tryin                                      g secondary
Dec 17 12:19:53 firefly ts3server_minimal_runscript.sh[174]: 2013-12-17 17:19:53                                      .714085|ERROR   |              |   | TS3ANetwork::ResolveHostName failed error:                                       -2 (Name or service not known) 0
Dec 17 12:19:53 firefly ts3server_minimal_runscript.sh[174]: 2013-12-17 17:19:53                                      .714111|ERROR   |Accounting    |   | license expired, shutting down!
Dec 17 12:19:53 firefly ts3server_minimal_runscript.sh[174]: 2013-12-17 17:19:53                                      .772479|INFO    |VirtualServerBase|  1| stopped
[root@firefly ~]# ps aux | grep "ts3"
admin      174  0.0  0.1  13896  1536 ?        Ss   12:19   0:00 /bin/sh /srv/ts3/ts3server_minimal_runscript.sh
admin      197  1.7  1.6 1249432 16916 ?       Sl   12:19   0:02 ./ts3server_linux_amd64
root       313  0.0  0.0   8956   656 pts/0    S+   12:22   0:00 grep ts3
[root@firefly ~]#

It's weird because right after boot, the server is running, but I can't connect, there's like no networking?  I opened port 2010 (the one it complains about) via iptables, so I know there isn't a problem with that, it doesn't need that anyway.  It's like it tries to load before networking starts perhaps?  Does anybody know if there's something I can add to my TeamSpeak service that it could check for?  Or something I can use to delay initialization?  I also use "systemctl daemon-reload" and "systemctl reload teamspeak" when I make edits to the service.  I know TeamSpeak doesn't like to run as root user, but I told it to run as a user "admin".

Thanks

Last edited by PolishHurricane (2013-12-19 23:01:25)

Offline

#2 2013-12-17 19:03:16

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [SOLVED] systemd services, TeamSpeak service

You use 'wants=network-online.target' but I doubt that exists. Have a look at https://wiki.archlinux.org/index.php/systemd#Targets for some useful pointers

Offline

#3 2013-12-17 19:54:08

PolishHurricane
Member
Registered: 2011-02-02
Posts: 47

Re: [SOLVED] systemd services, TeamSpeak service

So would I do something like: Wants=runlevel3.target  ?

I tried it, didn't work, sorry I'm kind of retarded.

Offline

#4 2013-12-19 19:31:47

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [SOLVED] systemd services, TeamSpeak service

Does runlevel3 exists in the output of `systemctl list-units --type=target`?

Offline

#5 2013-12-19 20:46:09

PolishHurricane
Member
Registered: 2011-02-02
Posts: 47

Re: [SOLVED] systemd services, TeamSpeak service

Aha!  Okay, it listed "network.target", I had "network-online.target", I just needed to change it to "network.target".

Thanks a bunch Spider.

Offline

Board footer

Powered by FluxBB