以bluebridge.tar.gz包为例子进行相关介绍
1.解压包
tar zxvf bluebridge.tar.gz
2.将解压包放在/usr/local/目录下
mv out /usr/local/bbserver
3.修改相应的配置文件
修改run_bbserver.sh文件
4.将其设置为开机启动服务
cd /etc/init.d
vim bbserver
#!/bin/bash
#description: bbserver
#chkconfig: 2345 20 81
EXEC_PATH=/usr/local/bbserver/
EXEC=run_bbserver.sh
DAEMON=/usr/local/bbserver/run_bbserver.sh
PID_FILE=/var/run/run_bbserver.sh.pid
. /etc/rc.d/init.d/functions
if [ ! -x $EXEC_PATH/$EXEC ] ; then
echo "ERROR: $DAEMON not found"
exit 1
fi
stop()
{
echo "Stoping $EXEC ..."
ps aux | grep "$DAEMON" | kill -9 `awk '{print $2}'` >/dev/null 2>&1
rm -f $PID_FILE
usleep 100
echo "Shutting down $EXEC: [ OK ]"
}
start()
{
echo "Starting $EXEC ..."
$DAEMON > /dev/null &
pidof $EXEC > $PID_FILE
usleep 100
echo "Starting $EXEC: [ OK ]"
}
restart()
{
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status -p $PID_FILE $DAEMON
;;
*)
echo "Usage: service $EXEC {start|stop|restart|status}"
exit 1
esac
exit $?
5.添加到开机服务中去
cd /etc/init.d
chmod 777 bbserver
6.授权
cd /usr/local/
chown -R myoldpc5.myoldpc5 bbserver
7.设置开机启动
8.重启机器