Fix markdown URL syntax error in README, spelling

Previously the wikipedia link to Read-eval-print_loop markdown URL in
the Componentry/Remote REPL section was inverted, ()[] vs. [](),
causing it to display incorrectly when rendered. This commit fixes the
syntax error.

This commit also corrects a couple of spelling errors.
Merge pull request #161 from marut/fix_readme_syntax_spelling

Fix markdown URL syntax error in README, spelling errors
(#14613) Don't fail when collecting exec resources

We were adding aliases for exec resources based on their command, which
is the namevar. This is so that we can properly lookup resources
referred to by relationship metaparameters when producing relationship
edges. However, exec resources aren't isomorphic, meaning they aren't
unique based on their namevar. This means we don't need to add those
aliases, because it's illegal to specify a relationship to an exec
resource using its command. It also means we were adding non-unique
aliases, which were evaluated on the agent after collecting the
resources, and could cause conflicts.
Merge pull request #162 from nicklewis/exported-exec-resources

Don't fail when collecting exec resources
Tolerate leading whitespace in puppetdb.conf

The INI file parser included in Puppet treats lines beginning with
whitespace to be continuation lines, adding them to the value of the
previous setting. This causes indentation to break puppetdb.conf, which
is undesired. For example:

[main]
  server = puppetdb.example.com
  port = 8081

This will cause the value of the server setting to be
"puppetdb.example.com\n  port = 8081", and the port setting will not be
set by the file, and will just default to 8080. This is definitely not
our desired behavior, and indentation is something we want. So the
INI parser has been replaced with a simple custom parser which handles
this the way we want it.
Merge pull request #163 from nicklewis/config-file-indentation

Tolerate leading whitespace in puppetdb.conf
(#14659) Compatibility with PG 8.1.x

RHEL5 ships with 8.1.23, and ARRAY declaration syntax was different waaaaaay
back then. Running PuppetDB with that vintage PG results in SQLExceptions
during initial migration.

In particular, while more recent PG versions support data type definitions like
“foo ARRAY NOT NULL”, PG 8.1 requires “foo ARRAY[1] NOT NULL”. The “1” is
ignored by PG (much like how it ignores the size of a VARCHAR column).

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
(#14665) Removal of SSL provider fails when class not available

For compatibility with OpenJDK and OpenSSL 1.0+, we remove a buggy OpenJDK
security provider. We do this by enumerating the current set of security
providers and removing the problematic ones by checking if they are the
instance of a specific class.

However, if that class doesn't exist on the system at all, we get a
ClassNotFoundException. We had a try/catch around this code for just that
reason, only it turns out the try/catch isn't getting invoked when the error is
thrown.

This is because that code lives at the top-level of the namespace, and is
executed when the namespace is compiled. But the compiler can't find all the
classes mentioned in the code it's trying to compile, and the
ClassNotFoundException is actually thrown at compile-time...before the
try/catch code is compiled and live.

The fix is to change the declaration of the class (which may not actually
exist) from a compile-time declaration to a run-time declaration (using
Class/forName).

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #165 from grimradical/ssl_classforname_14665

(#14665) Removal of SSL provider fails when class not available
Merge pull request #164 from grimradical/pg81_compat_14659

(#14659) Compatibility with PG 8.1.x
(#14586) Incorrect start-stop-daemon args in Debian init script

When we try to stop the daemon, we were passing in `--name puppetdb` instead of
`--exec $JAVA_BIN`. Since our process isn't actually named puppetdb, that
initial call wouldn't actually terminate the process. It would then
fall-through to a second code path where the init script would then try to kill
*all* processes with $JAVA_BIN as the executable. That's, like, not so great
and stuff.

I've corrected the args to start-stop-daemon to use both the pidfile and the
executable name to give us a precise match. With that in place, the secondary
code path is no longer necessary.

A pleasant side-effect of this fix is that now stopping PuppetDB is extremely
fast, instead of taking 30 seconds or so.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Update puppetdb to handle suse

This commit does some cleanup on the rakefile and moves the osfamily fact into
an instance variable accessible to erb templates. It updates the rpm spec
template to handle sles requires and buildrequires and also sets the rubylib
for suse.
Merge pull request #167 from haus/update_for_sles

Update puppetdb to handle suse
Merge pull request #166 from grimradical/init_script_14586

(#14586) Incorrect start-stop-daemon args in Debian init script
(#14691) num-resources shouldn't include GC-able things

num-resources currently includes resources that aren’t associated with any
node’s current catalog. This patch corrects the query so that it ignores any
resources associated solely with stale catalogs or deactivated nodes.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Population-wide metrics should ignore deactivated nodes

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Fix init script for EL based PE installations

Previously, we were grepping on username in the find_my_pid function of
the init script.  This was fine if the username was <= 8 characters, but
since pe-puppetdb is not, 'ps -ef' would fall back to using UID in the
processes table, thus causing the function to fail.  This in turn led to
empty pid files and puppetdb potentially starting lots of times.

We now grep the jarfile name rather than user to confine the process
listing.

Signed-off-by: Michael Stahnke <stahnma@puppetlabs.com>
Merge pull request #169 from stahnma/tickets/master/14736_rh_init_script_with_pe

Fix init script for EL based PE installations
Merge pull request #168 from grimradical/pop_queries_14691

(#14691) Population-wide metrics should ignore "stale" data
Make use of not= consistent

There are cases (in src/ and test/) where (not (= ..)) is used and (not=
..) is used. This change makes the uses consistent across the codebase.