Uploaded image for project: 'MCollective'
  1. MCollective
  2. MCO-753

Problem of pidfile with the mcollective service

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: MCO 2.8.7
    • Fix Version/s: MCO 2.8.8
    • Component/s: None
    • Environment:

      Ubuntu Trusty 14.02

    • Template:
    • Story Points:
      3
    • Sprint:
      RE 2016-03-02, RE 2016-03-09

      Description

      Hi,

      It's not a problem really concerning mcollective but rather its packaging in the AIO package puppet-agent. Here is the easy way to reproduce the problem on Ubuntu Trusty. It just consists in a quick and basic installation:

      # Basic installation
      root@client-trusty:~# wget http://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
      root@client-trusty:~# dpkg -i puppetlabs-release-pc1-trusty.deb
      root@client-trusty:~# apt-get update && apt-get install puppet-agent -y
       
      # mcollective service and puppet service are enabled.
      root@client-trusty:~# ls /etc/rc?.d | grep -E '(mcollective|puppet)'
      K20mcollective
      K20puppet
      K20mcollective
      K20puppet
      S20mcollective
      S20puppet
      S20mcollective
      S20puppet
      S20mcollective
      S20puppet
      S20mcollective
      S20puppet
      K20mcollective
      K20puppet
      root@client-trusty:~# 
       
      # mcollective service and puppet service are currently "not running".
      root@client-trusty:~# ps aux | grep -E '(mcollectiv[e]|agen[t])'
      root@client-trusty:~#
       
      # Now I reboot...
      root@client-trusty:~# reboot && exit
      

      After the reboot:

      # Now mcollective service and puppet service are currently "running".
      root@client-trusty:~# ps aux | grep -E '(mcollectiv[e]|agen[t])'
      root       763  0.1  3.6 234664 18108 ?        Sl   14:12   0:00 /opt/puppetlabs/puppet/bin/ruby /opt/puppetlabs/puppet/bin/mcollectived --pid=/var/run/puppetlabs/mcollectived.pid --config=/etc/puppetlabs/mcollective/server.cfg --daemonize
      root       787  3.0  7.5 215004 38044 ?        Ssl  14:12   0:01 /opt/puppetlabs/puppet/bin/ruby /opt/puppetlabs/puppet/bin/puppet agent
      root@client-trusty:~# 
       
      root@client-trusty:~# service puppet status
       * agent is running
      root@client-trusty:~#
       
       
      # But there is something wrong with the "mcollective" service.
      root@client-trusty:~# service mcollective status 
       * mcollective is not running
      root@client-trusty:~# 
       
      # The pid file is empty.
      root@client-trusty:~# echo -n 'pid=['; cat /var/run/puppetlabs/mcollectived.pid; echo ']'
      pid=[]
      root@client-trusty:~# 
      

      I have a similar problem if I want to disable the puppet service and keep the mcollective service enabled:

      # Now, I want to disable the "puppet" service and keep enabled the mcollective service.
      root@client-trusty:~# update-rc.d puppet disable
       
      root@client-trusty:~# reboot && exit
      

      And after the reboot:

      # Now just "mcollective" is running.
      root@client-trusty:~# ps aux | grep -E '(mcollectiv[e]|agen[t])'
      root       777  0.0  3.6 234664 18072 ?        Sl   14:18   0:00 /opt/puppetlabs/puppet/bin/ruby /opt/puppetlabs/puppet/bin/mcollectived --pid=/var/run/puppetlabs/mcollectived.pid --config=/etc/puppetlabs/mcollective/server.cfg --daemonize
      root@client-trusty:~# 
       
      # But already a problem with the "mcollective" daemon.
      root@client-trusty:~# service mcollective status
      touch: cannot touch '/var/run/puppetlabs/mcollectived.pid': No such file or directory
       * mcollective is not running
      root@client-trusty:~# 
       
      # The /var/run/puppetlabs directory no longer exists so
      # the pid file /var/run/puppetlabs/mcollectived.pid doesn't exist.
      root@client-trusty:~# ls -la /var/run/puppetlabs
      ls: cannot access /var/run/puppetlabs: No such file or directory
      root@client-trusty:~# 
      

      Currently, I use this workaround which works well. I edit the file /etc/default/mcollective like this:

      #START=true
      #DAEMON_OPTS="--pid ${pidfile}"
      pidfile="/var/run/mcollectived-puppetlabs.pid"
      daemonopts="--pid=${pidfile} --config=/etc/puppetlabs/mcollective/server.cfg"
      

      By the way, it seems to me that the content of the file /etc/default/mcollective provided by the puppet-agent package is irrelevant. Here is the content by default (out of the box from the package):

      START=true
      DAEMON_OPTS="--pid ${pidfile}"
      

      It seems to me irrelevant because the START and DAEMON_OPTS variables don't exist at all in the file /etc/init.d/mcollective.

      Regards.
      Fran├žois Lafont

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  flaf Francois Lafont
                  QA Contact:
                  Eric Thompson
                • Votes:
                  3 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: