Chinaunix首页 | 论坛 | 博客
  • 博客访问: 312884
  • 博文数量: 173
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1060
  • 用 户 组: 普通用户
  • 注册时间: 2014-11-09 16:23
文章分类

全部博文(173)

文章存档

2015年(66)

2014年(107)

我的朋友

分类: LINUX

2014-11-17 15:21:03

#!/bin/bash # chkconfig: - 85 15 #descrīption: service(/usr/local/gearmand-1.1.12/sbin/gearmand) . /etc/rc.d/init.d/functions

start() {  echo -n $"Starting $prog"  echo -e " gearman :															  [确定]"  /usr/local/gearmand-1.1.12/sbin/gearmand &  sleep 1  echo -e "running..." }
stop() {  echo -n $"Stopping $prog"  echo -e " gearman :															  [确定]"  kill -9 `ps -ef | grep "/usr/local/gearmand-1.1.12/sbin/gearmand" | awk '{print $2}' | awk 'NR==1'`  sleep 1  echo -e "stoped" }



case "$1" in  start)   start   ;;  stop)   stop   ;;  restart)   stop   start   ;;  status)   ps -ef | grep "/usr/local/gearmand-1.1.12/sbin/gearmand"   ;;  *)   echo $"Usage: $prog {start|stop|restart|status}" >&2   exit 1   ;;
esac exit 0

因为要跑到安装目录去启动gearman服务,所以今晚自给写了个service启动gearman脚本,如上(初次写服务脚本没有多大经验,见谅)

将脚本拷贝到/etc/init.d/目录下面,然后chkconfig --add gearmand

chkconfig --list或者ntsysv可以看到gearman服务

用sudo service gearmand start即可启动

  • 相关文章推荐:
  • 本文来自:
  • 本文链接:
阅读(623) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~