cups incapazes de se comunicar com o avahi-daemon quando executando como um serviço

2

Estou terminando de configurar meu Raspberry Pi em modo somente leitura e o serviço xícaras parece ser a última coisa que está me causando problemas.

Como cups escreve a configuração para / etc, decidi montar o / etc / cups como um sistema de sobreposição:

$ mount
...
overlay on /etc/cups type overlay (rw,relatime,lowerdir=/etc/cups_org,upperdir=/etc/cups_rw/upper,workdir=/etc/cups_rw/work)
...

O serviço cups inicia com êxito, eu posso acessar a página localhost: 631, no entanto indo para / subpágina admin resulta em "Internal server error" e a subpágina / printer mostra: Não é possível obter lista de impressoras: descritor de arquivo incorreto .

Durante a inicialização do serviço eu vejo no log:

E [03/Sep/2016:17:17:13 +0200] Unable to communicate with avahi-daemon: Daemon not running

enquanto o daemon avahi estiver ativo e em execução

Ao acessar a subpágina / admin, o registro mostra:

D [03/Sep/2016:18:22:39 +0200] [CGI] Started /usr/lib/cups/cgi-bin/admin.cgi (PID 5367)
I [03/Sep/2016:18:22:39 +0200] [Client 13] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=5367)
D [03/Sep/2016:18:22:39 +0200] [Client 13] file=14
D [03/Sep/2016:18:22:39 +0200] [Client 13] Waiting for CGI data.
D [03/Sep/2016:18:22:39 +0200] Report: clients=1
D [03/Sep/2016:18:22:39 +0200] Report: jobs=0
D [03/Sep/2016:18:22:39 +0200] Report: jobs-active=0
D [03/Sep/2016:18:22:39 +0200] Report: printers=1
D [03/Sep/2016:18:22:39 +0200] Report: stringpool-string-count=654
D [03/Sep/2016:18:22:39 +0200] Report: stringpool-alloc-bytes=6392
D [03/Sep/2016:18:22:39 +0200] Report: stringpool-total-bytes=11720
D [03/Sep/2016:18:22:39 +0200] cupsd is not idle any more, canceling shutdown.
D [03/Sep/2016:18:22:39 +0200] [CGI] admin.cgi started...
D [03/Sep/2016:18:22:39 +0200] cupsd is not idle any more, canceling shutdown.
E [03/Sep/2016:18:22:39 +0200] [CGI] Unable to connect to cupsd: Bad file descriptor
E [03/Sep/2016:18:22:39 +0200] [CGI] Unable to connect to cupsd: Bad file descriptor
D [03/Sep/2016:18:22:39 +0200] [CGI] cupsServer()="/var/run/cups/cups.sock"
D [03/Sep/2016:18:22:39 +0200] [CGI] ippPort()=631
D [03/Sep/2016:18:22:39 +0200] cupsd is not idle any more, canceling shutdown.
D [03/Sep/2016:18:22:39 +0200] [CGI] cupsEncryption()=0
D [03/Sep/2016:18:22:39 +0200] cupsd is not idle any more, canceling shutdown.
D [03/Sep/2016:18:22:39 +0200] [Client 13] CGI data ready to be sent.
D [03/Sep/2016:18:22:39 +0200] PID 5367 (/usr/lib/cups/cgi-bin/admin.cgi) stopped with status 1.

No entanto, quando eu parar o serviço e executar o programa manualmente:

/usr/sbin/cupsd -f

o problema não ocorre de todo. O log mostra:

D [03/Sep/2016:18:25:33 +0200] Avahi server connection now available, registering printers for Bonjour broadcasting.

E eu consigo acessar / admin (e todas as outras subpáginas):

D [03/Sep/2016:18:25:36 +0200] [CGI] Started /usr/lib/cups/cgi-bin/admin.cgi (PID 6269)
I [03/Sep/2016:18:25:36 +0200] [Client 17] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=6269)
D [03/Sep/2016:18:25:36 +0200] [Client 17] file=18
D [03/Sep/2016:18:25:36 +0200] [Client 17] Waiting for CGI data.
D [03/Sep/2016:18:25:36 +0200] cupsd is not idle any more, canceling shutdown.
D [03/Sep/2016:18:25:36 +0200] [CGI] admin.cgi started...
D [03/Sep/2016:18:25:36 +0200] cupsd is not idle any more, canceling shutdown.
D [03/Sep/2016:18:25:36 +0200] [Client 19] Accepted from localhost (Domain)
D [03/Sep/2016:18:25:36 +0200] [Client 19] Waiting for request.
D [03/Sep/2016:18:25:36 +0200] [CGI] http=0x554e9db8
D [03/Sep/2016:18:25:36 +0200] [CGI] cgiSetVariable: SECTION="admin"
D [03/Sep/2016:18:25:36 +0200] [CGI] cgiSetVariable: REFRESH_PAGE=""
D [03/Sep/2016:18:25:36 +0200] cupsd is not idle any more, canceling shutdown.
D [03/Sep/2016:18:25:36 +0200] [CGI] org.cups.sid cookie is "72b5efbcd72416115613b87b329ce911"
D [03/Sep/2016:18:25:36 +0200] [CGI] No form data, showing main menu...

Alguma dica sobre o que pode ser o motivo desse comportamento e como resolver o problema (alterar a configuração no arquivo cups.service?) ou pelo menos para agilizar ainda mais essa solução de problemas?

    
por endriu 03.09.2016 / 18:43

1 resposta

1

Eu tive um problema parecido, e o que me ajudou é que eu editei o arquivo: /usr/lib/systemd/system/org.cups.cupsd.service

[Unit]
Description=CUPS Scheduler
Documentation=man:cupsd(8)
After=network.target

[Service]
ExecStart=/usr/bin/cupsd -f

[Install]
Also=org.cups.cupsd.socket org.cups.cupsd.path
WantedBy=printer.target

E reiniciei o serviço como root ou com sudo :

# systemctl daemon-reload
# systemctl restart org.cups.cupsd
    
por 28.10.2016 / 12:29