-
# See how we were called.
-
case "$1" in
-
start)
-
start && exit 0
-
;;
-
stop)
-
stop || exit 0
-
;;
-
status)
-
status -p $pidfile $prog
-
#### 添加下边一行就可以了 ######
-
RETVAL=$?
#############################
-
;;
-
restart)
-
stop
-
start
-
RETVAL=$?
-
;;
-
*)
-
echo "Usage: $0 {start|stop|status|restart}"
-
exit 1
-
esac
-
-
exit $RETVAL
slow_query_conveter的启动脚本部分如上,添加了service,并且ensure => running, 结果不行,手动启动/etc/init.d/xxx 是可以的。
原因在 提到,更详细的是:
Puppet expects the initscript of the service to have a "status" command that returns 0 if the service is running and a non-zero value otherwise. This is the default behavior of puppet. Try to
$> sudo service
status
$> echo $? //Make sure you are getting the correct return values that puppet expects.
阅读(863) | 评论(0) | 转发(0) |