gpt4 book ai didi

linux - 在 Debian 8 上将 TeamSpeak3 作为服务运行

转载 作者:太空宇宙 更新时间:2023-11-04 12:26:32 24 4
gpt4 key购买 nike

我花了几个小时试图找到解决方案并且已经访问过。

我卡在启动服务点了(其他一切都很好,我可以手动启动 teamspeak 服务器)

我发现我的问题与我的 Debian 版本有关。

我的 uname -rv 返回:

 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30)

我上次的服务文件如下:

#! /bin/sh
### BEGIN INIT INFO
# Provides: ts3
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: TeamSpeak3 Server Daemon
# Description: Starts/Stops/Restarts the TeamSpeak Server

Daemon
### END INIT INFO
set -e

# PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="TeamSpeak3 Server"
NAME=teamspeak3-server
USER=ts3user
DIR=/home/ts3user/teamspeak3-server


DAEMON=$DIR/ts3server_startscript.sh
PIDFILE=/home/ts3user/teamspeak3-server/ts3server.pid
SCRIPTNAME=/etc/init.d/ts3

# Gracefully exit if the package has been removed.
# test -x $DAEMON || exit 0
# sleep 2
su $USER -c $DAEMON $1

我用过

sudo service ts3 start

sudo systemctl start ts3.service

都返回一个错误:

Job for ts3.service failed. See 'systemctl status ts3.service' and 'journalctl -xn' for details.

sudo 服务 ts3 状态返回:

 ● ts3.service - LSB: TeamSpeak3 Server Daemon
Loaded: loaded (/etc/init.d/ts3)
Active: failed (Result: exit-code) since Wed 2017-06-07 21:08:45 CEST; 49s ago
Process: 8941 ExecStart=/etc/init.d/ts3 start (code=exited, status=2)

Jun 07 21:08:45 vps419654.ovh.net su[8942]: Successful su for ts3user by root
Jun 07 21:08:45 vps419654.ovh.net su[8942]: + ??? root:ts3user
Jun 07 21:08:45 vps419654.ovh.net su[8942]: pam_unix(su:session): session opened for user ts3us...=0)
Jun 07 21:08:45 vps419654.ovh.net ts3[8941]: Usage: /home/ts3user/teamspeak3-server/ts3server_s...us}
Jun 07 21:08:45 vps419654.ovh.net systemd[1]: ts3.service: control process exited, code=exited ...s=2
Jun 07 21:08:45 vps419654.ovh.net systemd[1]: Failed to start LSB: TeamSpeak3 Server Daemon.
Jun 07 21:08:45 vps419654.ovh.net systemd[1]: Unit ts3.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

我遵循了很多指南,但都没有成功

my user for this puropse is **ts3user**
TS3 server is located in **/home/ts3user/teamspeak3-server/**
file that start TS3 server is **ts3server_startscript.sh**
file ts3 (service) is located in **/etc/init.d**

我在这个 ts3 文件中做错了什么?

最佳答案

首先使脚本可执行(在 ts3 的情况下并不真正需要)

sudo chmod +x /home/ts3user/teamspeak3-server/ts3server_startscript.sh

接下来尝试更改文件的所有者

cd /home/ts3user/
chown ts3user:ts3user teamspeak3-server/ -R

然后尝试以 ts3user 身份运行服务器

su - ts3user
cd /home/ts3user/teamspeak3-server/
./ts3server_startscript.sh

如果一切顺利,尝试以该用户身份运行服务

service ts3 start

关于linux - 在 Debian 8 上将 TeamSpeak3 作为服务运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44422835/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com