+ -
当前位置:首页 → 问答吧 → 菜鸟请教一个停止应用的脚本

菜鸟请教一个停止应用的脚本

时间:2010-08-24

来源:互联网

请教大家:

我需要一个脚本,大致是这样的:
#!/bin/sh
APACHE_TOP=/raid1/app/apache
POM_TOP=/raid1/app/dqappl/pom/11.5.0
COMMON_TOP=/raid1/app/dqappl/dqcomn
IAS_TOP=/raid1/app/a_dq/dqora/iAS


su - app
su root
$APACHE_TOP/bin/stopap.sh
exit
$POM_TOP/bin/MasterScript.sh stop

手动停止服务时时候先app用户登陆,然后转到root用户停应用中的apache服务,然后再退回到app用户停止其它的服务。
那么脚本里这个用户应该如何转换呢?其中root停apache服务时要用到app用户的环境变量。

谢谢各位了!

作者: chulylin   发布时间: 2010-08-24

#cat stop.sh
APACHE_TOP=/raid1/app/apache
POM_TOP=/raid1/app/dqappl/pom/11.5.0
COMMON_TOP=/raid1/app/dqappl/dqcomn
IAS_TOP=/raid1/app/a_dq/dqora/iAS

$APACHE_TOP/bin/stopap.sh

su - app -c "$POM_TOP/bin/MasterScript.sh stop"

用root执行这个脚本

作者: doni   发布时间: 2010-08-24

3X

作者: chulylin   发布时间: 2010-08-24

热门下载

更多