免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3410 | 回复: 1
打印 上一主题 下一主题

[puppet] puppetmaster无法启动 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-07-14 13:22 |只看该作者 |倒序浏览
我的Puppet是通过yum的方法来安装的,安装完成后,启动的时候报错,如下!
  1. [root@puppet ~]# /etc/init.d/puppetmaster start
  2. Starting puppetmaster: Could not prepare for execution: Invalid group: 0
  3.                                                            [FAILED]
复制代码
很郁闷,网上找了一下,就发现一个跟此有点相关的,说puppet不能以root用户启动,但是我看了一看启动脚本,没有发现哪里是以root的身份运行的,启动脚本如下
  1. [root@puppet ~]# cat /etc/init.d/puppetmaster
  2. #!/bin/bash
  3. # puppetmaster  This shell script enables the puppetmaster server.
  4. #
  5. # Authors:       Duane Griffin <d.griffin@psenterprise.com>
  6. #                Peter Meier <peter.meier@immerda.ch> (Mongrel enhancements)
  7. #
  8. # chkconfig: - 65 45
  9. #
  10. # description: Server for the puppet system management tool.
  11. # processname: puppetmaster

  12. PATH=/usr/bin:/sbin:/bin:/usr/sbin
  13. export PATH

  14. lockfile=/var/lock/subsys/puppetmaster
  15. pidfile=/var/run/puppet/master.pid

  16. # Source function library.
  17. . /etc/rc.d/init.d/functions

  18. if [ -f /etc/sysconfig/puppetmaster ]; then
  19.     . /etc/sysconfig/puppetmaster
  20. fi

  21. PUPPETMASTER_OPTS=""
  22. [ -n "$PUPPETMASTER_MANIFEST" ] && PUPPETMASTER_OPTS="--manifest=${PUPPETMASTER_MANIFEST}"
  23. if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
  24.     PUPPETMASTER_OPTS="$PUPPETMASTER_OPTS --servertype=mongrel"
  25. elif [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -eq 1 ]; then
  26.     PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"
  27. fi
  28. [ -n "$PUPPETMASTER_LOG" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --logdest ${PUPPETMASTER_LOG}"
  29. PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} \
  30.     ${PUPPETMASTER_EXTRA_OPTS}"

  31. # Determine if we can use the -p option to daemon, killproc, and status.
  32. # RHEL < 5 can't.
  33. if status | grep -q -- '-p' 2>/dev/null; then
  34.     daemonopts="--pidfile $pidfile"
  35.     pidopts="-p $pidfile"
  36. fi

  37. RETVAL=0

  38. prog=puppetmasterd
  39. PUPPETMASTER=/usr/sbin/$prog

  40. start() {
  41.     echo -n $"Starting puppetmaster: "

  42.     # Confirm the manifest exists
  43.     if [ -r $PUPPETMASTER_MANIFEST ]; then
  44.         if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
  45.             for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
  46.                 echo -en "\nPort: ${PUPPETMASTER_PORTS[$i]}"
  47.                 daemon $PUPPETMASTER $PUPPETMASTER_OPTS --masterport=${PUPPETMASTER_PORTS[$i]} --pidfile=/var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid
  48.                 ret=$?; [ $ret != 0 ] && RETVAL=$ret
  49.             done
  50.         else
  51.             daemon $daemonopts $PUPPETMASTER $PUPPETMASTER_OPTS
  52.             RETVAL=$?
  53.         fi
  54.     else
  55.         failure $"Manifest does not exist: $PUPPETMASTER_MANIFEST"
  56.         echo
  57.         return 1
  58.     fi
  59.     [ $RETVAL -eq 0 ] && touch "$lockfile"
  60.     echo
  61.     return $RETVAL
  62. }

  63. stop() {
  64.     echo -n  $"Stopping puppetmaster: "
  65.     if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
  66.         for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
  67.             echo -en "\nPort: ${PUPPETMASTER_PORTS[$i]}"
  68.             killproc -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster
  69.             ret=$?; [ $ret != 0 ] && RETVAL=$ret
  70.         done
  71.     else
  72.         killproc $pidopts $PUPPETMASTER
  73.         RETVAL=$?
  74.     fi
  75.     echo
  76.     [ $RETVAL -eq 0 ] && rm -f "$lockfile"
  77.     return $RETVAL
  78. }

  79. restart() {
  80.   stop
  81.   start
  82. }

  83. genconfig() {
  84.   echo -n $"Generate configuration puppetmaster: "
  85.   $PUPPETMASTER $PUPPETMASTER_OPTS --genconfig
  86. }

  87. rh_status() {
  88.     if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
  89.         for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
  90.             echo -en "Port ${PUPPETMASTER_PORTS[$i]}: "
  91.             status -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster
  92.             ret=$?; [ $ret != 0 ] && RETVAL=$ret
  93.         done
  94.     else
  95.         status $pidopts $PUPPETMASTER
  96.         RETVAL=$?
  97.     fi
  98.     return $RETVAL
  99. }

  100. rh_status_q() {
  101.         rh_status >/dev/null 2>&1
  102. }

  103. case "$1" in
  104.   start)
  105.       start
  106.     ;;
  107.     stop)
  108.         stop
  109.     ;;
  110.     restart|reload|force-reload)
  111.         restart
  112.     ;;
  113.     condrestart)
  114.         rh_status_q || exit 0
  115.         restart
  116.     ;;
  117.     status)
  118.         rh_status
  119.     ;;
  120.     genconfig)
  121.         genconfig
  122.     ;;
  123.     *)
  124.         echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|genconfig}"
  125.         exit 1
  126. esac

  127. exit $RETVAL
复制代码
谁能帮帮我,谢谢!

论坛徽章:
0
2 [报告]
发表于 2013-07-16 13:41 |只看该作者
怎么都没人回复啊!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP