logger: avoid using SIGHUP for detecting death of sheep

It seems that current method of detecting sheep's death from logger
process sometimes fails. The SIGHUP is caught as a request of log
rotation.

The problem comes from that SIGHUP is used for both of log rotation
request and death detection, and getppid() somestimes returns value
not equal to 1 when SIGHUP which is caused by the death rises.

This patch lets logger detect death of sheep viapolling. The detection
mechanism is simple: calling getppid() at the tail of the log flush
loop every time. It would be enough for practical death detection.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: exit when a passed path of log dir is not a directory

This patch lets sheep exit as soon as possible when the option of log
directory (specified with "-L") is not a directory, but an
ordinal file. When a path of ordinal file is passed, logger process
runs as a defunct process. This behavior is confusing for
administrators.

The purpose of this change is preventing operation miss. If sheep is
passed a wrong path name of log directory, it should notify the
mistake to administrator. Running without correct logging is really
wrose in production environment.

In addition, this patch does a trivial cleaning. The variable path in
main() of sheep is too generic. So this patch renames it to log_path.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>

Conflicts:
	sheep/sheep.c

Conflicts were resolved by Hitoshi Mitake. In addition, the commit log
is updated for the stable-0.7.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>

Changes for backporting are reviewed by MORITA Kazutaka.
Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
logger: add syslog support as a log destination

A new option '-s' is added for using syslog as a log destination.

This patch is based on the commit 275dcf916ed0: logger: add a unified
log destination option and syslog support. But the change for
backporting is too large so this commit log is rewrote as a new one.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>

Changes for backporting are reviewed by MORITA Kazutaka.
Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>