Kenneth Holter
2008-Oct-16 12:37 UTC
[Puppet Users] Error in Puppetmaster/Mongrel init script.
Hello. I''m running RHEL 4, and have just installed Mongrel and Nginx. I found and have tried this init script: http://github.com/duritong/puppet-puppet/tree/master/files/cluster/init.d/puppetmaster.CentOS Starting puppetmaster works fine, but when I try stopping it I get a "pidof: invalid options on command line!" error messages. Seems like this is the line that causes to error: killproc -p $PUPPETMASTER_PID_DIR/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid $PUPPETMASTER Is this a known problem with this scripts? If so, are there any fixes for it? Greets, Kenneth --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Peter Meier
2008-Oct-17 09:47 UTC
[Puppet Users] Re: Error in Puppetmaster/Mongrel init script.
Hi> I''m running RHEL 4, and have just installed Mongrel and Nginx. > > I found and have tried this init script: > http://github.com/duritong/puppet-puppet/tree/master/files/cluster/init.d/puppetmaster.CentOS > > Starting puppetmaster works fine, but when I try stopping it I get a "pidof: > invalid options on command line!" error messages. > > Seems like this is the line that causes to error: > > killproc -p $PUPPETMASTER_PID_DIR/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid > $PUPPETMASTER > > Is this a known problem with this scripts? If so, are there any fixes for > it?as I''m the author of the mongrel extensions for the init.d script (and you''re using my repo) and as I''m currently rebasing and improving it to get included into puppet, I should or at least can answer that: The script have only be used and tested on centos 5 (which is rhel 5) and it works fine there. The problem of your error is, that the killproc function defined in /etc/rc.d/init.d/functions on rhel/centos 4 systems doesn''t accept a -p option, while it is present on rhel/centos 5 systems. However it seems that I only needed to use this -p option because I made the pid-dir configurable, which was somehow anyway not a good idea. As discussed with David Lutterkort and mentioned in #1460 [1] I''ll change the init.d scripts with the according needs and ideas and there will be an improved version be published today. And I''ll try to make it rhel 4 compatible. It would be nice if you could test it then, as I think rhel 4 compatibility should be there for init-scripts. Can I ping you later to test it? greets pete [1] http://projects.reductivelabs.com/issues/show/1460 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Peter Meier
2008-Oct-17 10:51 UTC
[Puppet Users] Re: Error in Puppetmaster/Mongrel init script.
Hi> However it seems that I only needed to use this -p option because I made > the pid-dir configurable, which was somehow anyway not a good idea. As > discussed with David Lutterkort and mentioned in #1460 [1] I''ll change > the init.d scripts with the according needs and ideas and there will be > an improved version be published today. And I''ll try to make it rhel 4 > compatible. > > It would be nice if you could test it then, as I think rhel 4 > compatibility should be there for init-scripts. Can I ping you later to > test it?hmm the problem seems to lay deeper and I currently don''t see any way how that would work on rhel/centos 4. The main problem is, that the puppetmaster in a mongrel setup have to be started with different pidfiles, however rhel/centos 4-functions don''t support different pidfiles. For further discussion about that, see ticket #1460 [1]. If you find any solution or have an idea, please let me know. greets pete [1] http://projects.reductivelabs.com/issues/show/1460 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Kenneth Holter
2008-Oct-21 05:55 UTC
[Puppet Users] Re: Error in Puppetmaster/Mongrel init script.
I see. I''ll take a look at ticket #1460, and if I come up with something I''ll post it here for discussion. Regards, Kenneth On 10/17/08, Peter Meier <peter.meier@immerda.ch> wrote:> > > Hi > > > However it seems that I only needed to use this -p option because I made > > the pid-dir configurable, which was somehow anyway not a good idea. As > > discussed with David Lutterkort and mentioned in #1460 [1] I''ll change > > the init.d scripts with the according needs and ideas and there will be > > an improved version be published today. And I''ll try to make it rhel 4 > > compatible. > > > > It would be nice if you could test it then, as I think rhel 4 > > compatibility should be there for init-scripts. Can I ping you later to > > test it? > > > hmm the problem seems to lay deeper and I currently don''t see any way > how that would work on rhel/centos 4. > The main problem is, that the puppetmaster in a mongrel setup have to be > started with different pidfiles, however rhel/centos 4-functions don''t > support different pidfiles. > > For further discussion about that, see ticket #1460 [1]. If you find any > solution or have an idea, please let me know. > > greets pete > > [1] http://projects.reductivelabs.com/issues/show/1460 > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Kenneth Holter
2008-Oct-23 13:23 UTC
[Puppet Users] Re: Error in Puppetmaster/Mongrel init script.
Here''s a suggestion on how to start and stop the puppetmasters. I''m sure improvements can be made (especially removing the pid file), but maybe it can be used as a starting point: start() { # 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 -n "Starting puppetmaster on port ${PUPPETMASTER_PORTS[$i]}...." daemon $PUPPETMASTER $PUPPETMASTER_OPTS --ssl_client_header=HTTP_X_SSL_SUBJECT --masterport=${PUPPETMASTER_PORTS[$i]} --pidfile=$PUPPETM ASTER_PID_DIR/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid RETVAL=$? || $RETVAL echo "" done else daemon $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() { status $PUPPETMASTER >/dev/null RETVAL=$? if [ $RETVAL -gt 0 ]; then echo "Puppetmaster is not running..." return 1 fi if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do local pidfile=$PUPPETMASTER_PID_DIR/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid PID=`cat $pidfile` echo -n "Stopping puppetmaster on port ${PUPPETMASTER_PORTS[$i]} (PID $PID) ..." kill -TERM $PID VAL=$? if [ $VAL -eq 0 ]; then echo_success else echo_failure fi rm -f $pidfile VAL=$? if [ $VAL -gt 0 ]; then echo "*** ERROR: Could not remove PID file $pidfile!" fi RETVAL=$? || $RETVAL echo "" done else killproc $PUPPETMASTER RETVAL=$? fi echo [ $RETVAL -eq 0 ] && rm -f "$lockfile" return $RETVAL } Greets, Kenneth On 10/17/08, Peter Meier <peter.meier@immerda.ch> wrote:> > > Hi > > > However it seems that I only needed to use this -p option because I made > > the pid-dir configurable, which was somehow anyway not a good idea. As > > discussed with David Lutterkort and mentioned in #1460 [1] I''ll change > > the init.d scripts with the according needs and ideas and there will be > > an improved version be published today. And I''ll try to make it rhel 4 > > compatible. > > > > It would be nice if you could test it then, as I think rhel 4 > > compatibility should be there for init-scripts. Can I ping you later to > > test it? > > > hmm the problem seems to lay deeper and I currently don''t see any way > how that would work on rhel/centos 4. > The main problem is, that the puppetmaster in a mongrel setup have to be > started with different pidfiles, however rhel/centos 4-functions don''t > support different pidfiles. > > For further discussion about that, see ticket #1460 [1]. If you find any > solution or have an idea, please let me know. > > greets pete > > [1] http://projects.reductivelabs.com/issues/show/1460 > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---