Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avahi issues #155

Closed
PiotrC1 opened this issue Sep 1, 2016 · 15 comments
Closed

Avahi issues #155

PiotrC1 opened this issue Sep 1, 2016 · 15 comments
Labels

Comments

@PiotrC1
Copy link

PiotrC1 commented Sep 1, 2016

I have installed Optware-ng on ARM7 router (Tomato by shibby). I found two issues regardsing avahi:

  1. There is no startup script in /opt/etc/init.d/ for Avahi,
  2. After installing Avahi DBus complains during startup:
root@Tomato:/tmp/home/root# /opt/etc/init.d/S20dbus start
Starting system message bus: Unknown username "avahi" in message bus configuration file
Unknown group "netdev" in message bus configuration file
dbus.
@alllexx88 alllexx88 added the bug label Sep 2, 2016
@alllexx88
Copy link
Collaborator

I'll look into adding an rc script. As for the dbus issue, I think it makes sense to change user and group to "nobody", since they're definite to be on a Linux system, and we can't add our own users/groups for systems with read-only rootfs like routers.

@PiotrC1
Copy link
Author

PiotrC1 commented Sep 2, 2016

OK, let us try. Should I do something?

@PiotrC1
Copy link
Author

PiotrC1 commented Sep 4, 2016

I was unable to upgrade, so I have started from scratch ince again. After installing Avahi tgere is an error:

root@Tomato:/tmp/home/root# avahi-daemon
/opt/sbin/avahi-daemon: can't load library 'libavahi-core.so.7'

In the meantime I propose following /opt/etc/init.d/S42Avahi

#!/bin/sh
ENABLED=yes
PROCS=avahi-daemon
ARGS="-D"
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:

. ./opt/etc/init.d/rc.func

(taken from Avahi at entware-ng)

@alllexx88
Copy link
Collaborator

I was unable to upgrade, so I have started from scratch once again

Sometimes it takes a few tries to upgrade, but it's always doable.

/opt/sbin/avahi-daemon: can't load library 'libavahi-core.so.7'

Yeah, I forgot to list libavahi-core as avahi dependency, it's being rebuilt now. I didn't write back because I wanted to test this myself first.

In the meantime I propose following /opt/etc/init.d/S42Avahi

Thanks, but we don't need an rc script for avahi-daemon, as I found out, since it's being managed by dbus

@PiotrC1
Copy link
Author

PiotrC1 commented Sep 4, 2016

Well, now libcap.so.2 is missing ...

@PiotrC1
Copy link
Author

PiotrC1 commented Sep 4, 2016

I have installed libcap manually and problem is gone.

Thanks, but we don't need an rc script for avahi-daemon, as I found out, since it's being managed by dbus

Well, if I start avahi-browse -a in order to see advertisment of Avahi I get:
Failed to create client object: Deamon not running
On the other side, when I start Avahi daemon manually, it dies quickly (at least when I try to see advertisments with avahi-browse).

@alllexx88
Copy link
Collaborator

OK, so let's first make it work, and then decide if we need an rc script or not. libcap dependency is indeed needed. cups doesn't log avahi-related errors for me any more, so I thought it was OK. However, if I start it manually, it dies with this message (testing on MIPSEL tomatousb shibby mod):

[root@unknown root]$ avahi-daemon
Found user 'nobody' (UID 65534) and group 'nobody' (GID 65534).
Successfully dropped root privileges.
chroot.c: fork() failed: Resource temporarily unavailable
failed to start chroot() helper daemon.

This error led me here: lxc/lxc#25
And indeed, if I set rlimit-nproc = 300 (I had exactly 3 processes running as nobody) in /opt/etc/avahi/avahi-daemon.conf (see lxc/lxc#25 (comment)), it works fine, together with avahi-advertise:

[root@unknown root]$ avahi-daemon
Found user 'nobody' (UID 65534) and group 'nobody' (GID 65534).
Successfully dropped root privileges.
avahi-daemon 0.6.31 starting up.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Successfully called chroot().
Successfully dropped remaining capabilities.
Loading service file /services/sftp-ssh.service.
Loading service file /services/ssh.service.
Joining mDNS multicast group on interface br0.IPv4 with address xxx.xxx.xxx.xxx
New relevant interface br0.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for xxx.xxx.xxx.xxx on br0.IPv4.
Registering HINFO record with values 'MIPS'/'LINUX'.
Server startup complete. Host name is unknown.local. Local service cookie is 1915423308.
Service "unknown" (/services/ssh.service) successfully established.
Service "unknown" (/services/sftp-ssh.service) successfully established.
#other session
[root@unknown root]$ avahi-browse -a
+    br0 IPv4 unknown [xx:xx:xx:xx:xx:xx]                   _workstation._tcp    local
+    br0 IPv4 unknown                                       _ssh._tcp            local
+    br0 IPv4 unknown                                       _sftp-ssh._tcp       local
#some other slightly sensitive output

@PiotrC1
Copy link
Author

PiotrC1 commented Sep 5, 2016

Perfectly. After increasing rlimit-nproc from 3 (as it was default) to 300 avahi works and advertises printer and other services. I still cannot print on iOS wia AirPrint as some cups filters are missing as well as mime types.

@alllexx88
Copy link
Collaborator

@PiotrC1

I still cannot print on iOS wia AirPrint

If you stay with me, we'll make it so you can 😃 I don't have iOS on my setup, and cups works fine for my needs

cups filters are missing as well as mime types.

I got your point about cups filters:

lpr: Unsupported document-format "image/jpeg".

As for mime.types and mime.convs, they're simply installed to wrong location: /opt/etc/cups, and it should be /opt/share/cups/mime. I'll fix it too

@alllexx88
Copy link
Collaborator

@PiotrC1 Ive fixed libcap dependency, soon will be online. But what's the problem with mime? I discovered that mime files were already installed:

[root@unknown root]$ ls /opt/share/cups/mime/mime.*
/opt/share/cups/mime/mime.convs  /opt/share/cups/mime/mime.types
[root@unknown root]$ ipkg search /opt/share/cups/mime/mime.convs
cups - 2.1.2-5

There were just older versions of this files needlessly installed to /opt/etc/cups (which are now removed). So, what mime issues are you having exactly?

@PiotrC1
Copy link
Author

PiotrC1 commented Sep 5, 2016

@alllexx88

If you stay with me, we'll make it so you can 😃 I don't have iOS on my setup, and cups works fine for my needs

Thanks for your promise. If you use Cups as print server, this installation is OK (I do the same on Raspberry PI and it works like a charm). If you print form inside Linux or from iOS you need some more tweaking (again on Raspberry PI they as present as it's Debian).

As for mime.types and mime.convs, they're simply installed to wrong location: /opt/etc/cups, and it should be /opt/share/cups/mime. I'll fix it too

Be carefull - if you read cups log you will see that CUPS reads both locations (one, /opt/etc/cups id provided by CUPS itself, the other one is provided by cups-filters package).
The problem with printing jpegs from inside Linux are rather missing filters - see enclosed:

E [05/Sep/2016:15:46:49 +0200] Filter \"pdftops\" not found.
E [05/Sep/2016:15:46:49 +0200] Filter \"hpgltops\" not found.
E [05/Sep/2016:15:46:49 +0200] Filter \"texttops\" not found.
E [05/Sep/2016:15:46:49 +0200] Filter \"imagetops\" not found.
E [05/Sep/2016:15:46:49 +0200] Filter \"imagetoraster\" not found.
I [05/Sep/2016:15:46:49 +0200] Loaded MIME database from "/opt/share/cups/mime" and "/opt/etc/cups": 43 types, 3 filters...

That's the reason I ask for adding cups-filters package.

@alllexx88
Copy link
Collaborator

@PiotrC1 I've read that for recent cups it's just share/cups/mime/mime.* that matter. If others are needed for cups-filters, then they'll be shipped with this package. I'm off for now, the next thing to do is adding cups-filters, which I'll get too as soon as I can

@PiotrC1
Copy link
Author

PiotrC1 commented Sep 8, 2016

Bug in S68avahi-daemon:
;; missing just before stop)

@alllexx88
Copy link
Collaborator

@PiotrC1 Thanks, fixed. Can we close this issue now?

@PiotrC1
Copy link
Author

PiotrC1 commented Sep 9, 2016

Yest, definitelly.

@PiotrC1 PiotrC1 closed this as completed Sep 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants