puppetmaster无法启动
我的Puppet是通过yum的方法来安装的,安装完成后,启动的时候报错,如下!# /etc/init.d/puppetmaster startStarting puppetmaster: Could not prepare for execution: Invalid group: 0
很郁闷,网上找了一下,就发现一个跟此有点相关的,说puppet不能以root用户启动,但是我看了一看启动脚本,没有发现哪里是以root的身份运行的,启动脚本如下# cat /etc/init.d/puppetmaster
#!/bin/bash
# puppetmasterThis shell script enables the puppetmaster server.
#
# Authors: Duane Griffin <d.griffin@psenterprise.com>
# Peter Meier <peter.meier@immerda.ch> (Mongrel enhancements)
#
# chkconfig: - 65 45
#
# description: Server for the puppet system management tool.
# processname: puppetmaster
PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH
lockfile=/var/lock/subsys/puppetmaster
pidfile=/var/run/puppet/master.pid
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/puppetmaster ]; then
. /etc/sysconfig/puppetmaster
fi
PUPPETMASTER_OPTS=""
[ -n "$PUPPETMASTER_MANIFEST" ] && PUPPETMASTER_OPTS="--manifest=${PUPPETMASTER_MANIFEST}"
if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
PUPPETMASTER_OPTS="$PUPPETMASTER_OPTS --servertype=mongrel"
elif [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -eq 1 ]; then
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS}"
fi
[ -n "$PUPPETMASTER_LOG" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --logdest ${PUPPETMASTER_LOG}"
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} \
${PUPPETMASTER_EXTRA_OPTS}"
# Determine if we can use the -p option to daemon, killproc, and status.
# RHEL < 5 can't.
if status | grep -q -- '-p' 2>/dev/null; then
daemonopts="--pidfile $pidfile"
pidopts="-p $pidfile"
fi
RETVAL=0
prog=puppetmasterd
PUPPETMASTER=/usr/sbin/$prog
start() {
echo -n $"Starting puppetmaster: "
# Confirm the manifest exists
if [ -r $PUPPETMASTER_MANIFEST ]; then
if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
echo -en "\nPort: ${PUPPETMASTER_PORTS[$i]}"
daemon $PUPPETMASTER $PUPPETMASTER_OPTS --masterport=${PUPPETMASTER_PORTS[$i]} --pidfile=/var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid
ret=$?; [ $ret != 0 ] && RETVAL=$ret
done
else
daemon $daemonopts $PUPPETMASTER $PUPPETMASTER_OPTS
RETVAL=$?
fi
else
failure $"Manifest does not exist: $PUPPETMASTER_MANIFEST"
echo
return 1
fi
[ $RETVAL -eq 0 ] && touch "$lockfile"
echo
return $RETVAL
}
stop() {
echo -n$"Stopping puppetmaster: "
if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
echo -en "\nPort: ${PUPPETMASTER_PORTS[$i]}"
killproc -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster
ret=$?; [ $ret != 0 ] && RETVAL=$ret
done
else
killproc $pidopts $PUPPETMASTER
RETVAL=$?
fi
echo
[ $RETVAL -eq 0 ] && rm -f "$lockfile"
return $RETVAL
}
restart() {
stop
start
}
genconfig() {
echo -n $"Generate configuration puppetmaster: "
$PUPPETMASTER $PUPPETMASTER_OPTS --genconfig
}
rh_status() {
if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
echo -en "Port ${PUPPETMASTER_PORTS[$i]}: "
status -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster
ret=$?; [ $ret != 0 ] && RETVAL=$ret
done
else
status $pidopts $PUPPETMASTER
RETVAL=$?
fi
return $RETVAL
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload|force-reload)
restart
;;
condrestart)
rh_status_q || exit 0
restart
;;
status)
rh_status
;;
genconfig)
genconfig
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|genconfig}"
exit 1
esac
exit $RETVAL
谁能帮帮我,谢谢! 怎么都没人回复啊!:dizzy:
页:
[1]