Fix: plugin: Reset the scheduling policy of daemons to SCHED_OTHER with nice value -10

SCHED_RESET_ON_FORK flag is enabled to prevent children of lrmd from
inheriting the scheduling policy.
Fix: On cluster signoff, make sure that the g_source gets disconnected.

With the FALSE value this didn't happen, and so spurious incoming events
could cause a segfault as the link is already destroyed, and so
s->hbchan->llc_ops in libhbclient would already be NULL but got
dereferenced.

Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Merge pull request #372 from phmarek/master

Fix: On cluster signoff, make sure that the g_source gets disconnected.
Merge pull request #369 from gao-yan/services-reset-scheduler

Fix: services: Reset the scheduler policy of children to SCHED_OTHER if not
Check for compiler flags with -Werror

For example for -fstack-protector, it is accepted by gcc for
all targets, however those targets where it is actually not
supported, it will print a warning like

"-fstack-protector is not supported for this platform"

which raises an error when using -Werror later. So better
not add -fstack-protector then to the CC_EXTRA_FLAGS
Fix: crm_resource: Wait for a reply for each request to crmd

Otherwise if it exits once it gets the first reply, the later requests
will probably not be handled.
Merge pull request #376 from gao-yan/crm_resource-reply

Fix: crm_resource: Wait for a reply for each request to crmd
Fix: fencing: Deep copy current topology level list on remote op
Merge pull request #378 from davidvossel/master

Fix: fencing: Deep copy current topology level list on remote op
Fix: ipc: Ensure buffer environment variable is read before setting max buffer len
Fix: ipc: Client buffer size must never fall below our max read size
Low: mainloop: Don't allow client buf size to be determined by hardcoded value given to mainloop
Merge pull request #377 from davidvossel/ipc_buf_size_detection

ipc buffer size related fixes
Fix: crm_master: Avoid sending redundant "--node" options to crm_attribute
Fix: crmd: don't segfault on shutdown when using heartbeat

The interface to use G_main_add_ll_cluster() was broken (incomplete)
since it was introduced.
->delete() does cleanup and free most of it, but it does not
actually remove and destroy the corresponding GSource, so the next
prepare/check iteratioin would find a corrupt (because partially
freed) GSource, and segfault.

So better use ->delete only after g_main_loop_quit().

Apparently one was supposed to store the GSource as returned by
G_main_add_ll_cluster(), and g_source_destroy() that "by hand".

But no-one ever did this, not even in the old hb code when this was
introduced.

Note that fsa_cluster_conn was set as an "alias" to cluster->hb_conn
in do_ha_control() right after crm_cluster_connect(), and only
happens to still point at that object, because do_ha_control() does
not reset it to NULL after crm_cluster_disconnect() above does
reset cluster->hb_conn to NULL.
Not sure if that's something to cleanup, too.

I'll try to fix this up in heartbeat proper, so ->delete
will actually remove, and destroy, and unref, and free this thing.
Doing so after g_main_loop_quit() is valid with both old,
and eventually fixed heartbeat.

If we introduce the "by hand" destroy/remove/unref,
this may break again (double free...) once heartbeat is fixed :-(
Fix: crmd: kill pengine on shutdown also when using heartbeat

If this is a heartbeat cluster, kill the pengine
in pe_ipc_destroy already.

The pe_subsystem->pid was set to -1 too early,
in pe_ipc_destroy, but without actually killing it.

Now stop_subsystem() in do_stop() would find it "already stopped",
and do nothing.

We would "leak" a pengine process, which may lead to problems
on next cluster start, especially when there was an update meanwhile.
The still running pengine may use outdated libraries/binaries.

There may be other problems as well when re-attaching
to a still running pengine.
Fix: iso8601: Prevent dates from jumping backwards a day in some timezones

Effect was that each day between 7pm and midnight PDT (or equivalent for
any -ve time zone offset, west of UTC), pengine beams itself one day
into the past.

Missing failure-timeout and other deadlines until the first second after
midnight, localtime.
High: doc: Baremetal remote-node documentation and tutorial
Merge pull request #380 from lge/for-beekhof

Fix segfault on shutdown and left-over pengine process on heartbeat stack -- prevent dates from jumping backwards
Merge pull request #379 from gao-yan/crm_master-node

Fix: crm_master: Avoid sending redundant "--node" options to crm_attribute