diff --git a/data/etc/avahi/services/domain.service b/data/etc/avahi/services/domain.service new file mode 100644 index 000000000..f6210c17b --- /dev/null +++ b/data/etc/avahi/services/domain.service @@ -0,0 +1,12 @@ + + + + + %h + + + _domain._udp + 53 + + + diff --git a/data/etc/avahi/services/sftp-ssh.service b/data/etc/avahi/services/sftp-ssh.service new file mode 100644 index 000000000..bfe1a0fe4 --- /dev/null +++ b/data/etc/avahi/services/sftp-ssh.service @@ -0,0 +1,14 @@ + + + + + %h + + + _sftp-ssh._tcp + 22 + path=/home/fbx + u=fbx + + + diff --git a/data/etc/avahi/services/ssh.service b/data/etc/avahi/services/ssh.service new file mode 100644 index 000000000..7090f20dd --- /dev/null +++ b/data/etc/avahi/services/ssh.service @@ -0,0 +1,12 @@ + + + + + %h + + + _ssh._tcp + 22 + + + diff --git a/data/etc/avahi/services/xmpp-server.service b/data/etc/avahi/services/xmpp-server.service new file mode 100644 index 000000000..4dc9b063e --- /dev/null +++ b/data/etc/avahi/services/xmpp-server.service @@ -0,0 +1,12 @@ + + + + + %h + + + _xmpp-server._tcp + 5269 + + + diff --git a/plinth/modules/avahi/__init__.py b/plinth/modules/avahi/__init__.py index 6e4dd43ba..57d276c26 100644 --- a/plinth/modules/avahi/__init__.py +++ b/plinth/modules/avahi/__init__.py @@ -21,6 +21,7 @@ Plinth module for service discovery. from django.utils.translation import ugettext_lazy as _ +from plinth import actions from plinth import cfg from plinth import service as service_module from plinth.menu import main_menu @@ -35,7 +36,7 @@ is_essential = True managed_services = ['avahi-daemon'] -managed_packages = ['avahi-daemon'] +managed_packages = ['avahi-daemon', 'avahi-utils'] name = _('Service Discovery') @@ -66,6 +67,11 @@ def init(): def setup(helper, old_version=False): """Install and configure the module.""" helper.install(managed_packages) + # Reload avahi-daemon now that first-run does not reboot. After performing + # Plinth package installation, new Avahi files will be available and + # require restart. + helper.call('post', actions.superuser_run, 'service', + ['reload', 'avahi-daemon']) class AvahiServiceView(ServiceView): diff --git a/setup.py b/setup.py index 1eb6ef043..6f1b3e89e 100755 --- a/setup.py +++ b/setup.py @@ -235,6 +235,8 @@ setuptools.setup( glob.glob('data/etc/apache2/sites-available/*.conf')), ('/etc/apache2/includes', glob.glob('data/etc/apache2/includes/*.conf')), + ('/etc/avahi/services/', + glob.glob('data/etc/avahi/services/*.service')), ('/etc/ikiwiki', glob.glob('data/etc/ikiwiki/*.setup')), ('/etc/NetworkManager/dispatcher.d/',