QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 768|回复: 1

看到国外一个将TEAMSPEAK服务器用服务进行启动的脚本

[复制链接]
发表于 2003-12-7 16:22:31 | 显示全部楼层 |阅读模式
看到一个国外的脚本,但是不知道该如何操作。(英文不好)

好心人,请帮我说说吧,谢谢


#! /bin/sh
#
# tss2serverd is an init script for Team Speak 2 Server running under chroot on RedHat 9
#
# Based on debian version written by Alexander Skwar <[email protected]>
#
# chkconfig: 345 93 20
# description: Starts and stops the Team Speak 2 server in a chroot environment.
# processname: server_linux
#
# To run the teamspeak server in a chroot jail you need to do the following:
#
# 1. Install tss2 server into a directory, for instance /home/teamspeak
#
# 2. You need to prepare /home/teamspeak to allow operation as a chroot directory:
# In /home/teamspeak create the following directories:
# * etc
# * dev
# * lib
# * tmp
# * usr
# * usr/lib
# * usr/lib/gconv
# * usr/lib/locale
# * var
# * var/run
#
# 3. Copy the following files into the corresponding directories you created above:
#
# * /etc/group
# * /etc/ld.so.conf
# * /etc/localtime
# * /etc/passwd
# * /lib/ld-linux.so.2
# * /lib/libc.so.6
# * /lib/libdl.so.2
# * /lib/libncurses.so.5
# * /lib/libpthread.so.0
# * /usr/lib/gconv/ISO8859-15.so
# * /usr/lib/gconv/gconv-modules
# * /usr/lib/locale/locale-archive
#
# 4. TSS2 needs /dev/null, which has to be created in /home/teamspeak.
# As root, change into the dev directory in /home/teamspeak and do:
#
# mknod null c 1 3
# chmod 0666 null
#
# 5. Create a user and group teamspeak, with login shell /bin/false
#
# 6. In /home/teamspeak, setup server_linux to run as teamspeak user
#
# chown teamspeak.teamspeak server_linux
# chmod 6770 server_linux
#
# 7. Place this file (i.e. tss2serverd) in /etc/rc.d/init.d
#
# cp tss2serverd.txt /etc/rc.d/init.d/tss2serverd
#
# 8. Run the following command:
#
# chkconfig --add tss2serverd
#
# 9. Use RH9 "services configuration" GUI to manage
#


#Source function library.
. /etc/init.d/functions

# CHANGE NEXT 3 LINES TO MATCH YOUR CONFIG
CHROOT_DIR=/home/teamspeak
EXEC=/server_linux
PID=/home/teamspeak/server.pid

DAEMON=${CHROOT_DIR}${EXEC}
PNAME=server_linux
DESC="TeamSpeak 2 Server"

test -x $DAEMON || exit 0

case "$1" in
start)
echo "Starting $DESC"
daemon chroot ${CHROOT_DIR} $EXEC $1
;;
stop)
echo "Stopping $DESC"
killproc $PNAME
;;
restart|force-reload)
echo "Restarting $DESC"
$0 stop && sleep 5 && $0 start && sleep 5 || return=$rc_failed
;;
*)
if [ ! -e ${PID} ]; then
echo "Usage: tss2serverd {start|stop|restart|force-reload}" >&2
else
echo "Team Speak 2 server is running with pid (`cat ${PID}`)" >&2
fi
exit 1
;;
esac

exit 0
 楼主| 发表于 2003-12-7 20:41:24 | 显示全部楼层
ding
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-15 11:55 , Processed in 0.042506 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表