Linux注册系统服务步骤
1.编写服务脚本
2.拷贝到/etc/init.d目录下
3.为服务脚本添加可执行权限 >>chmod a+x xxxd
4.添加到系统服务中 >>chkconfig --add xxxd
5.检测是否添加成功 >>chkconfig --list | grep xxxd
6.设置开机启动 >>chkconfig xxxd on
7.删除系统服务命令 >>chkconfig --del xxxd
#!/bin/bash
# chkconfig: -
# description: asr service
#设置启动文件
startup=/home/test/src/asr_server
#设置相应的环境变量
export LD_LIBRARY_PATH=/home/test/lib:$LD_LIBRARY_PATH
start(){
echo -n "Starting asr service:"
RETVAL=`ps -ef |grep asr_serve[r] |awk -F " " '{print $2}'`
if [ -n $RETVAL ];then
$startup
fi
echo "asrserver is succeessfully started up"
}
stop(){
echo -n "Shutting down tomca

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/80116.html