- 论坛徽章:
- 0
|
操作系统: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
|
|