new routines for socket based synchronisation

Add new function, rlWaitForSocket, that can wait for a network service
to start. To be used instead of `sleep' when testing network-centric
services.

Signed-off-by: Hubert Kario <hkario@redhat.com>
add synchronisation to system library

Make beakerlib load synchronisation related routines by default
and install them.

Signed-off-by: Hubert Kario <hkario@redhat.com>
use internal killtree, to not leave running sleep commands behind

Just killing the sub shell running won't send kill signal to
running commands, use treekill to kill all processes in process
tree. Also gets rid of the ugly bash reports of tasks terminated
in background.

Signed-off-by: Hubert Kario <hkario@redhat.com>
add rlWaitForCmd

add routine that allows waiting for any command to return
specified exit code

Signed-off-by: Hubert Kario <hkario@redhat.com>
change rlWaitForSocket to use shared code

remove code duplication, add support for extra option: -d delay

Signed-off-by: Hubert Kario <hkario@redhat.com>
add rlWaitForFile

add synchronisation mechanism that can wait for file creation

Signed-off-by: Hubert Kario <hkario@redhat.com>
add tests for all synchronisation routines

Signed-off-by: Hubert Kario <hkario@redhat.com>
testwatcher: protect against invalid EWD_SECS value

Signed-off-by: Jiri Jaburek <jjaburek@redhat.com>
add rlWait

since the bash builtin `wait' command does not provide any kind of
timeout, we need to wrap it around a method that will allow
for killing the process we wait for

this does not duplicate functionality of rlWatchdog, as it does
use wait builtin and returns the background command exit code

allows to remove some code duplication in __INTERNAL_wait_for_cmd()

Signed-off-by: Hubert Kario <hkario@redhat.com>
rlWaitForSocket - add waiting for socket closure

Add ability to wait for the socket to stop listening.

Signed-off-by: Hubert Kario <hkario@redhat.com>
rlServiceStart: Start even when stop failed

BZ#615291

rlServiceStart stops the service when it is running at the time of
running. Previously, it did not start the service when this stop failed.
Now it tries to start the service in this case. It still returns non-0
RC and warns about the failure.
Merge branch 'master' into journal

Conflicts:
	src/Makefile