shell-16: /etc/init.d/slurm-serverd

来源:互联网 发布:健体冠军杰瑞米数据 编辑:程序博客网 时间:2024/04/30 17:40
#!/bin/sh## chkconfig: 2345  80 50# description: slurm_server is for setup the socket at slurm side#             # processname: slurm_server ## Source function library.. /etc/rc.d/init.d/functionsret=0 start() {echo "start slurm_server, setup the socket.."daemon /usr/local/bin/slurm_server &ret=$?exit $ret}stop() {echo "stop slurm_server"kill $(ps -ef | grep slurm_server | grep -v grep | awk '{print $2}')ret=$?} status() {local resultecho "check status of slurm_server..."result=$( ps aux|grep slurm_server|grep -v grep| awk '{print $8}' )echo "result=$result"#if [ "$result" = "Ss" -o "$result" = "R+" ]; thenif [ "$result" = "Ss" ] || [ "$result" = "R+" ]; thenecho "slurm_server is up"ret=0elseecho "slurm_server is down"ret=1fi} case "$1" instart)        start        ;;  stop)        stop        ;;  status)          status        ;;  *)echo $"Usage: $0 {start|stop|status}"exit 1esac exit $ret

原创粉丝点击