The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #14736

EL init script from pe-puppetdb-0.9.0-1.el6.noarch doesn't properly manage PID file

Added by Ryan Coleman over 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:05/29/2012
Priority:NormalDue date:
Assignee:Deepak Giridharagopal% Done:

0%

Category:-
Target version:0.9.1
Keywords: Affected PuppetDB version:
Branch:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

operatingsystem => CentOS
operatingsystemrelease => 6.0
puppetversion => 2.7.12 (Puppet Enterprise 2.5.0)

PuppetDB was installed from the pe-puppetdb-0.9.0-1.el6.noarch package via the Puppet Labs PE yum repo.

When the service is first started (during package installation), the PID file located at /var/run/pe-puppetdb/pe-puppetdb is created as a 0-byte file. Removing the PID and starting the service again results again in an empty file (it’s not a borked file form initial install).

Because of this, I cannot check the status of the service with init:

[root@master pe-puppetdb]# service pe-puppetdb status
pe-puppetdb dead but pid file exists

The service is running:

[root@master pe-puppetdb]# ps auwx | grep puppetdb
490       4620 25.6 45.3 1162864 228036 ?      Sl   02:05   0:22 /usr/bin/java -Xmx192m -jar /opt/puppet/share/puppetdb/puppetdb.jar services -c /etc/puppetlabs/puppetdb/conf.d

Asking the service to start produces another daemon:

[root@master pe-puppetdb]# service pe-puppetdb start
Starting pe-puppetdb:                                      [  OK  ]
[root@master pe-puppetdb]# ps auwx | grep puppetdb
490       4620 16.1 39.8 1162864 200352 ?      Sl   02:05   0:22 /usr/bin/java -Xmx192m -jar /opt/puppet/share/puppetdb/puppetdb.jar services -c /etc/puppetlabs/puppetdb/conf.d
490       4737 51.2 14.0 1096876 70584 ?       Sl   02:07   0:02 /usr/bin/java -Xmx192m -jar /opt/puppet/share/puppetdb/puppetdb.jar services -c /etc/puppetlabs/puppetdb/conf.d

Aside from an inability to manage the service, the daemon is fully functional and I’m able to do use puppetdb with my PE environment.

It seems that the culprit lies with the find_my_pid function:

find_my_pid() {
    if [ ! -d  "/var/run/$prog" ] ; then
      mkdir -p /var/run/$prog
      chown -R $USER:$USER /var/run/$prog
    fi
    pid=`ps -ef | grep $JAVA_BIN | grep ^$USER | grep " services -c " | awk '{print $2}'`
}

We don’t get the username back from ps because pe-puppetdb is too long. Instead we get the PID.

Could we not just grep for $JARFILE instead of $USER? Then we’re saying we must hit — /usr/bin/java + services -c + puppetdb.jar — which is pretty specific.

History

#1 Updated by Ryan Coleman over 2 years ago

  • Description updated (diff)

#2 Updated by Ryan Coleman over 2 years ago

  • Description updated (diff)

#3 Updated by Michael Stahnke over 2 years ago

  • Status changed from Unreviewed to In Topic Branch Pending Review
  • Assignee set to Deepak Giridharagopal

#4 Updated by Deepak Giridharagopal about 2 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Target version set to 0.9.1

This was merged a while back, but I forgot to update the ticket accordingly.

#5 Updated by Matthaus Owens about 2 years ago

Released in PuppetDB 0.9.1

#6 Updated by Matthaus Owens about 2 years ago

  • Status changed from Merged - Pending Release to Closed

Also available in: Atom PDF