| Stopping puppet on hn stops it in all VE [message #14704] | 
			Fri, 06 July 2007 16:15   | 
		 
		
			
				
				
				
					
						  
						ugob
						 Messages: 271 Registered: March 2007 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		HN: centos4 
VE: centos4 
 
[root@hn init.d]# vzctl exec 101 /etc/init.d/puppet status 
puppetd (pid 5994) is running... 
 
[root@hn init.d]# service puppet stop 
Stopping puppet:                                           [  OK  ] 
[root@hn init.d]# vzctl exec 101 /etc/init.d/puppet status 
puppetd is stopped 
 
Please let me know if you need more info. 
 
Here is the puppet init script: 
 
#!/bin/bash
# puppet        Init script for running the puppet client daemon
#
# Author:       Duane Griffin <d.griffin@psenterprise.com>
#               David Lutterkort <dlutter@redhat.com>
#
# chkconfig: - 98 02
#
# description: Enables periodic system configuration checks through puppet.
# processname: puppet
# config: /etc/sysconfig/puppet
PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH
[ -f /etc/sysconfig/puppet ] && . /etc/sysconfig/puppet
lockfile=${LOCKFILE-/var/lock/subsys/puppet}
pidfile=${PIDFILE-/var/run/puppet.pid}
puppetd=${PUPPETD-/usr/sbin/puppetd}
RETVAL=0
# Source function library.
. /etc/rc.d/init.d/functions
PUPPET_OPTS=""
[ -n "${PUPPET_SERVER}" ] && PUPPET_OPTS="--server=${PUPPET_SERVER}"
[ -n "$PUPPET_LOG" ] && PUPPET_OPTS="${PUPPET_OPTS} --logdest=${PUPPET_LOG}"
[ -n "$PUPPET_PORT" ] && PUPPET_OPTS="${PUPPET_OPTS} --port=${PUPPET_PORT}"
# Figure out if the system just booted. Let's assume
# boot doesn't take longer than 5 minutes
## Not used for now
##[ -n "$INIT_VERSION" ] && PUPPET_OPTS="${PUPPET_OPTS} --fullrun"
start() {
        echo -n $"Starting puppet: "
        daemon $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch ${lockfile}
        return $RETVAL
}
stop() {
        echo -n $"Stopping puppet: "
        killproc $puppetd
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
reload() {
        echo -n $"Restarting puppet: "
        killproc $puppetd -HUP
        RETVAL=$?
        echo
        return $RETVAL
}
restart() {
    stop
    start
}
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  reload|force-reload)
        reload
        ;;
  condrestart|try-restart)
        [ -f "$pidfile" ] && restart
        ;;
  status)
        status $puppetd
        ;;
  once)
        shift
        $puppetd -o ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} $@
        ;;
  *)
        echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|once}"
        exit 1
esac
exit $RETVAL
 
		
		
  Please read the manual before asking questions: 
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf 
 
Please have a look at the wiki before asking questions: 
http://wiki.openvz.org/Main_Page
		
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	
		
		
			| Re: Stopping puppet on hn stops it in all VE [message #14746 is a reply to message #14732] | 
			Mon, 09 July 2007 13:48    | 
		 
		
			
				
				
				
					
						  
						ugob
						 Messages: 271 Registered: March 2007 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		| n00b_admin wrote on Mon, 09 July 2007 06:16 |   This is a "problem" i also ran into. 
 
You do not run any services on the hn that you run on the ve's. 
  |  
  
 
I know we should not run any real services on the HN, but I still need to monitor/configure it.  For example, crond works perfectly on the HN and when I do a 'service crond stop' on the HN, it only stops the instance on the HN, not in the VEs. 
 
| n00b_admin wrote on Mon, 09 July 2007 06:16 |  
  
 
I don't know how the puppet daemon works but i presume it works as a client-server (as far as i understood from their wiki), so you run the master on the hn and the clients on the ve's. 
 
That should not pose any problems. Again if i understood correctly how puppet works.
  |  
  
 
There is no problem running puppet on the HN, except for this problem.  Well, the service tests on the HN are not done correctly, because if you tell puppet to make sure crond runs on the HN, it will say it is running even if it is not, because it sees all the VE's instances.  I'll try monitoring the HN with nagios instead, but I'll still be configuring the HN with puppet. 
 
Thanks, 
		
		
  Please read the manual before asking questions: 
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf 
 
Please have a look at the wiki before asking questions: 
http://wiki.openvz.org/Main_Page
		
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	
		
		
			| Re: Stopping puppet on hn stops it in all VE [message #14749 is a reply to message #14748] | 
			Mon, 09 July 2007 13:59    | 
		 
		
			
				
				
				
					
						  
						ugob
						 Messages: 271 Registered: March 2007 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		I don't see how the script is different from crond's: 
 
(stop parts only) 
 
Puppet:stop() {
        echo -n $"Stopping puppet: "
        killproc $puppetd
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
 
 
Crond:stop() {
        echo -n $"Stopping $prog: "
        if [ ! -e /var/lock/subsys/crond ]; then
            echo -n $"cannot stop crond: crond is not running."
            failure $"cannot stop crond: crond is not running."
            echo
            return 1;
        fi
        killproc crond
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/crond;
        return $RETVAL
}
 
 
I'd gladly submit this to the puppet's developpers, but I can't see how the behaviour is different.
		
		
  Please read the manual before asking questions: 
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf 
 
Please have a look at the wiki before asking questions: 
http://wiki.openvz.org/Main_Page
		
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	| 
		
 |