7 Star 11 Fork 11

zstackio/zstack-utility

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
zstack-appliancevm 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
Frank Zhang 提交于 10年前 . initial commit
#!/bin/sh
# the following is chkconfig init header
#
# zstack-appliancevm: zstack appliance vm agent daemon
#
# chkconfig: 345 97 03
# description: This is a daemon instructed by zstack management server \
# to perform appliance vm related operations\
# See http://zstack.org
#
# processname: appliancevm
# pidfile: /var/run/zstack/appliancevm.pid
#
check_status() {
pidfile='/var/run/zstack/appliancevm.pid'
if [ ! -f $pidfile ]; then
echo "zstack appliance vm agent is stopped"
exit 1
else
pid=`cat $pidfile`
ps -p $pid > /dev/null
if [ $? -eq 0 ]; then
echo "zstack appliance vm agent is running, pid is $pid"
exit 0
else
echo "zstack appliance vm is stopped, but pidfile at $pidfile is not cleaned. It may be caused by the agent crashed at last time, manually cleaning it would be ok"
exit 1
fi
fi
}
if [ $# -eq 0 ]; then
echo "usage: $0
[start|stop|restart|status]"
exit 1
fi
if [ "$@" = "status" ]; then
check_status
else
. /var/lib/zstack/virtualenv/appliancevm/bin/activate && python -c "from appliancevm import daemon; daemon.main()" $@
fi
if [ $? -eq 0 ]; then
echo "$@ zstack appliance vm agent .... SUCCESS"
exit 0
else
echo "$@ zstack appliacen vm agent .... FAILED"
exit 1
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zstackio/zstack-utility.git
git@gitee.com:zstackio/zstack-utility.git
zstackio
zstack-utility
zstack-utility
master

搜索帮助