unix: improve the command-line parsing and logging

We perform command-line parsing before we daemonize, so early error
messages can be printed to the console. If we daemonize, then we
log via syslog; otherwise we print to stdout.

Add 2 new command-line options:
  -daemon : if we want to daemonize (default false)
  -pidfile <file> : location to write the pidfile

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Switch to mirage indenting style for server_unix.ml

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Avoid opening the event channel in a top-level binding

This is a privileged operation and one which is only needed if you
want to use the xen shared-memory interface. It's useful to run a
server unprivileged in userspace on a non-xen host for testing.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
unix: use cmdliner to make command-line parsing more polished

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
unix: improve the help text, add some examples

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
unix: diagnose errors binding to the unix domain socket

If we have insufficient privileges to bind to a socket (e.g. if
we attempt to bind the system-wide default socket as non-root)
then tell the user how to fix the problem.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
unix: diagnose failures to read /proc/xen/xsd*

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
unix: always use the proper logger so failures in daemon mode go to syslog

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
unix: make it a fatal error if no transports are selected

No transports means nothing to do, which is almost-certainly not
what the user wanted.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
unix: convert more stderr logs to use the proper logger

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
unix: check directories exist, catch Unix errors, generally improve logging

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
unix: include version number from file VERSION

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Merge pull request #4 from djs55/improve-unix-main

Unix userspace: better commandline, better error diagnosis