免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1802 | 回复: 0
打印 上一主题 下一主题

[系统安装] suse 自定义开机启动服务问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-04-17 09:35 |只看该作者 |倒序浏览
操作系统:Linux Sles10 2.6.16.60-0.74.7.3086.1. x86_64 GNU/Linux

问题描述:
    1.通过以下操作步骤1,2 重启机器测试时,发现服务没有启动。但通过手工./auto_etl start 是能启动服务的。发现在日志
/var/log/boot.msg
#more boot.msg | grep auto
<notice>auto_etl start
Starting Automation...
<notice>'auto_etl start' exits with status 0

#more boot.omsg | grep auto
<notice>auto_etl start
Starting automation...
<notice>'auto_etl start' exits with status 0
<notice>auto_etl stop
Stoping auto_etl...
<notice>'auto_Automation stop' exits with status 0

  2.如果用./auto_etl start 去启动服务时(是通过root 登录 su etl 启动服务的),服务是启动了但我的前台应用程序没有写文件的权限(这个是前台程序的功能)。但我在它自己的用户下面来启动这个服务(直接用etl登录系统启动服务)是可以运行我前台程序的。这两种启动服务的ps -ef | grep auto 出来都有一个etl用户的进程。

以下两个问题请大家多多指教。

操作步骤:

1.在/etc/init.d 创建了一个文件auto_etl

#!/bin/bash
ETL_AutoHome=/home/etl
case "$1" in
    start)
       echo "Starting Automation..."
       su etl -c "sh $ETL_AutoHome/bin/AutoStart.sh"
       echo "Started."
      ;;
    stop)
      echo "Stoping Automation..."
      su etl -c "sh $ETL_AutoHome/bin/AutoStop.sh"
      echo "Stoped."
      ;;
    *)
        echo "use script with args 'start'|'status'|'stop'"
        exit 1
esac
exit 0

2.将auto_etl添加到服务里
chkconfig --add 345 auto_etl



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

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP