Use 'expect fork' when starting avahi-daemon

We need to wait for avahi-daemon to fork otherwise e.g. 'start avahi'
returns immediately, i.e. before the daemon is ready to serve. This is
a problem for Avahi-using programs - such as p2p-server - that assumes
(and rightly so) that Avahi is running and operational when its
Upstart job has been started. This CL fixes this problem by simply

  1. Requesting avahi-daemon to fork by passing the --daemonize option
  2. Instructing Upstart to wait for avahi-daemon to fork

BUG=None
TEST=Manually tested

Change-Id: I122ec1bb4d7bef77377dd80ced50c0e647a25cbf
Reviewed-on: https://gerrit.chromium.org/gerrit/60792
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
diff --git a/test-init/avahi.conf b/test-init/avahi.conf
index b2e1359..4c3cf60 100644
--- a/test-init/avahi.conf
+++ b/test-init/avahi.conf
@@ -17,7 +17,9 @@
   ip6tables -I INPUT -p udp --dport 5353 -j ACCEPT
 end script
 
-exec avahi-daemon --syslog
+expect fork
+
+exec avahi-daemon --daemonize --syslog
 
 post-stop script
   # Delete the firewall rules we previously added