首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

linux程序->服务

2013-01-07 
求助:linux程序--服务现在我写了一个c++程序,生成了可执行文件。我想把它搞成服务,怎么做呢?[解决办法]网

求助:linux程序-->服务
现在我写了一个c++程序,生成了可执行文件。我想把它搞成服务,怎么做呢?
[解决办法]
网上资料多的是,给你找了两篇:
http://www.diybl.com/course/6_system/linux/Linuxjs/2008810/135558.html
http://54min.com/post/how-linux-started-configure-services.html
[解决办法]


[root@RHEL6A scripts]# vim s7.sh 
[root@RHEL6A scripts]# more s7.sh 
#!/bin/bash

while [ $# -gt 0 ]; do
    case $1 in
        start)
            echo 'process starting...'
            exit 0
            ;;
        stop)
            echo 'process stoping...'
            exit 0
            ;;
        *)
            echo "Internal Error: option processing error: $1" 1>&2
            exit 1
            ;;
    esac
done

[root@RHEL6A scripts]# chmod u+x s7.sh 
[root@RHEL6A scripts]# ./s7.sh start
process starting...
[root@RHEL6A scripts]# 

热点排行