multipathd: enable core dumps for systemd

Add 'LimitCORE' definition to the service file to enable core
dumps when running under systemd.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Use correct systemd unit directory

The systemd unit directory has been moved to /usr/lib/systemd.

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipathd: Implement systemd watchdog integration

In the past there have been several instances where multipathd
would hang with the checkerloop as some path checker might not
be able to return in time.
This patch now activates the watchdog feature from systemd
to shutdown (and possibly restart) multipathd in these
situations.
Due to a bug in systemd watchdog integration only works
correctly with later version (> 206), so watchdog integration
has been disabled per default.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Remove trailing spaces from sysfs attributes

Some sysfs attributes may contain trailing spaces, which only
serve to confuse matters. So strip them before continuing.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Document 'wwids_file' and 'reservation_key'

Add documentation for 'wwids_file' and 'reservation_key' to
multipath.conf.annotated.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: Fix typo in retain_attached_hw_handler

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipath: do not print 'path is up' for removed paths

When a path is removed the previous checker message is still
kept in the checker context, and will be printed upon each
check. This causes multipath to print out
'path is up'
even though it already has been removed from sysfs.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: proactively remove path

When path_offline() detects a removed path we really do not need
to wait for any uevent to arrive, but can remove the path
straightaway.

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipath: do not call tur in sync mode if pthread_cancel fails

When pthread_cancel fails the thread is stuck, most likely
during I/O submission. So it would be pointless to call the
tur checker in sync mode here, as this would be stuck, too.
Hence we should rather return 'PATH_TIMEOUT' and hope the
situation resolves itself over time.

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipathd: Update manpage

Some aliases for CLI command arguments were missing from the
manpage.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reset timezone information on reconfigure

Whenever 'reconfigure' is called we need to re-initialize the
timezone information as it might have been changed in the
meantime.

References: bnc#830511

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipathd: Correctly initialize udev context

The udev context is passed as argument to ueventloop(), so
we should be using that instead of the global variable.

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipathd: add path when transitioned from 'blocked' state

When a path is discovered in 'blocked' state it won't be added
to the path list as we cannot get the path uuid.
And any further check will fail here as the uuid won't be
recovered. So add a check in checkerloop() to re-add the
path if it gets out of a 'blocked' state.

Signed-off-by: Hannes Reinecke <hare@suse.de>
[libmultipath] Fix a compilation warning

Now that we chop the sysfs attribute strings, the size returned
by strlcpy is not used anymore. Remove the variable to tame
the compiler warning.
Add missing includes to support tzget() usage