| # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| description "Start the avahi daemon" |
| author "chromium-os-dev@chromium.org" |
| |
| # Note: this job is not automatically started on boot-up. It is expected |
| # to be started manually (e.g. "initctl start avahi" or similar) by |
| # software (such as the auto-update system) that needs it. |
| |
| respawn |
| |
| pre-start script |
| # Add firewall rules to allow mDNS traffic |
| iptables -I INPUT -p udp --dport 5353 -j ACCEPT |
| ip6tables -I INPUT -p udp --dport 5353 -j ACCEPT |
| end script |
| |
| expect fork |
| |
| exec avahi-daemon --daemonize --syslog |
| |
| post-stop script |
| # Delete the firewall rules we previously added |
| iptables -D INPUT -p udp --dport 5353 -j ACCEPT |
| ip6tables -D INPUT -p udp --dport 5353 -j ACCEPT |
| end script |