Author Topic: Printer sharing service always has to be restarted (Zentyal 3.4)  (Read 5315 times)

rindi

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Since the upgrade to Zentyal 3.4 the shared printers service stops after some time. When I restart it again, I can print , but again the service will automatically stop after a while. How can I keep the service running?

jbahillo

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1444
  • Karma: +77/-2
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #1 on: June 17, 2014, 02:48:02 pm »
Hello: I think you should look at cups logs (/var/log/cups/*) in order to get some reason why it is stopping


Best regards

Geelong PC Creations

  • Zen Apprentice
  • *
  • Posts: 18
  • Karma: +1/-0
    • View Profile
    • geelong pc creations
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #2 on: June 18, 2014, 09:12:35 am »
I think it has something to do with one of the maintainence processes can't remember which one but it is supposed to restart cups after its done but fails to start it I'll go through my notes to get some less vague details but as I remember it wasn't cups failing it was the process

Geelong PC Creations

  • Zen Apprentice
  • *
  • Posts: 18
  • Karma: +1/-0
    • View Profile
    • geelong pc creations
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #3 on: June 20, 2014, 07:15:37 am »
i could be wrong but going over my notes i think it had something to do with avahi-cups-reload command not working apparently a work around is discussed here https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/1158686 i haven’t tested it but i stopped using the printer sharing module ass i have network printers and not a large amount of users

rindi

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #4 on: June 22, 2014, 04:15:57 pm »
Thanks for the above comments and link, but it hasn't helped me to resolve the issue. I'd prefer using a network printer too, but I'm afraid none of my printers have a builtin NIC.

I also wouldn't know what to look for in the cups log.

vargax

  • Zen Apprentice
  • *
  • Posts: 6
  • Karma: +1/-0
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #5 on: June 22, 2014, 06:13:41 pm »
Hi,

I'm facing the same issue after update from 3.3 to 3.4 with printers and ipsec services... I had removed both modules, purge and reinstall CUPS and Openswan... no way...

I end up making a cron script that check the status of both modules and start they if they are stooped... It is a pretty bad solution but it works until I have time to setup a clean installation, probably after the release of Zentyal 3.5

Code: [Select]
#!/bin/bash
# List of the services we are going to check...
services=('printers' 'ipsec');

for service in "${services[@]}";
do
    status=$(eval "service zentyal $service status")
    if [[ $status == *STOPPED* ]]
    then
        service zentyal $service start
    fi
done

Just put it in /etc/cron.hourly and make it executable (chmod +x)...

rindi

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #6 on: June 27, 2014, 12:19:14 pm »
Thanks for the last comment. But it doesn't really seem to help. Although if I run the script manually printing becomes available again, it seems that it doesn't actually do cron job. Must the script file have a particular name in order to run as a cron job, or is there a ways to check what cron jobs are scheduled?

jgould

  • Zen Monk
  • **
  • Posts: 52
  • Karma: +6/-0
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #7 on: July 22, 2014, 08:48:57 pm »
I'm seeing this same behavior in 3.5. I also had it in 3.4

The printers module at this point is pretty much useless to me. It hasn't worked correctly for me since 3.4 and I don't see anyone on the zentyal side really interested in looking at it. Almost like not many people use it so why bother...

jgould

  • Zen Monk
  • **
  • Posts: 52
  • Karma: +6/-0
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #8 on: July 25, 2014, 03:17:39 pm »
I'm going to open a ticket with this information (although lately it doesn't seem like anyone is looking at them), but I wanted to post it here as well.

Running the latest 3.5 and every single day the printer module stops and needs to be manually restarted.
The /var/log/cups/errors file has this in it from today.

Code: [Select]
W [25/Jul/2014:09:09:22 -0400] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [25/Jul/2014:09:09:22 -0400] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [25/Jul/2014:09:09:22 -0400] CreateDevice failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [25/Jul/2014:09:09:22 -0400] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [25/Jul/2014:09:09:22 -0400] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [25/Jul/2014:09:09:22 -0400] CreateDevice failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [25/Jul/2014:09:09:22 -0400] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [25/Jul/2014:09:09:22 -0400] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [25/Jul/2014:09:09:22 -0400] CreateDevice failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
E [25/Jul/2014:09:09:22 -0400] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [25/Jul/2014:09:09:22 -0400] Unable to bind socket for address 127.0.0.1:631 - Address already in use.
E [25/Jul/2014:09:09:22 -0400] Unable to bind socket for address 192.168.0.5:631 - Address already in use.


Code: [Select]
||/ Name                                 Version                 Architecture            Description
+++-====================================-=======================-=======================-=============================================================================
ii  zentyal                              3.5                     all                     Zentyal - Core metapackage
ii  zentyal-antivirus                    3.5                     all                     Zentyal - Antivirus
ii  zentyal-ca                           3.5.1                   all                     Zentyal - Certification Authority
ii  zentyal-common                       3.5                     all                     Zentyal - Common Library
ii  zentyal-core                         3.5.2                   all                     Zentyal - Core
ii  zentyal-dns                          3.5.1                   all                     Zentyal - DNS Service
ii  zentyal-ebackup                      3.5                     all                     Zentyal - Backup
ii  zentyal-firewall                     3.5                     all                     Zentyal - Firewall
ii  zentyal-ha                           3.5.2                   all                     Zentyal - High Availability
ii  zentyal-monitor                      3.5                     all                     Zentyal - Monitor
ii  zentyal-network                      3.5.1                   all                     Zentyal - Network Configuration
ii  zentyal-ntp                          3.5                     all                     Zentyal - NTP Service
ii  zentyal-objects                      3.5                     all                     Zentyal - Network Objects
ii  zentyal-office                       3.5                     all                     Zentyal - Office Suite
ii  zentyal-openvpn                      3.5                     all                     Zentyal - VPN Service
ii  zentyal-printers                     3.5.1                   all                     Zentyal - Printer Sharing Service
ii  zentyal-remoteservices               3.5                     all                     Zentyal - Cloud Client
ii  zentyal-samba                        3.5.3                   all                     Zentyal - Users, Computers and File Sharing
ii  zentyal-services                     3.5.1                   all                     Zentyal - Network Services
ii  zentyal-software                     3.5                     all                     Zentyal - Software Management
ii  zentyal-squid                        3.5.2                   all                     Zentyal - HTTP Proxy (Cache and Filter)
ii  zentyal-trafficshaping               3.5                     all                     Zentyal - Traffic Shaping
un  zentyal-users                        <none>                  <none>                  (no description available)

jbahillo

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1444
  • Karma: +77/-2
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #9 on: July 25, 2014, 05:04:25 pm »
Hello:

Based on the erro you mention:
Quote
E [25/Jul/2014:09:09:22 -0400] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [25/Jul/2014:09:09:22 -0400] Unable to bind socket for address 127.0.0.1:631 - Address already in use.
E [25/Jul/2014:09:09:22 -0400] Unable to bind socket for address 192.168.0.5:631 - Address already in use.

it seems to me that zentyal and upstart are trying to start the same daemon. Could you please paste the output of netstat -patun | grep 631, when at start, Zentyal talls you that Printer Sharing is not running?


Can you make sure if despite of this warning, printing is working?

jgould

  • Zen Monk
  • **
  • Posts: 52
  • Karma: +6/-0
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #10 on: July 26, 2014, 11:03:38 pm »
The problem is, unless I sit and watch for 24 hours, I don't really know when the module stops working. But the errors in the log I posted was when the printer module had stopped and an hour before that it was started. So make of that what you will.

When the printer module is stopped, printing doesn't work.

output of netstat -patun | grep 631
Code: [Select]
tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN      5519/cupsd
tcp6       0      0 :::631                  :::*                    LISTEN      5519/cupsd
This is while the printer module is started and functional. I assume you'd like to see this output when it is stopped so I'll have to wait for it to mess up again and post back.


Another error in the logs;
Code: [Select]
E [25/Jul/2014:09:42:44 -0400] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [25/Jul/2014:09:43:47 -0400] SSL shutdown failed: Error in the push function.

thefreeaccount

  • Zen Apprentice
  • *
  • Posts: 7
  • Karma: +1/-0
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #11 on: July 28, 2014, 02:36:24 am »
Not sure whether this will help, but after I upgraded Zentyal from 3.4 to 3.5, cups would stop working every day because the logrotate configuration for cups was not creating the new cups log files with the correct permissions. I "fixed" by disabling logrotate for cups.

Unfortunately, I don't recall seeing those "address already in use" errors.

jgould

  • Zen Monk
  • **
  • Posts: 52
  • Karma: +6/-0
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #12 on: July 28, 2014, 02:22:26 pm »
The problem is, unless I sit and watch for 24 hours, I don't really know when the module stops working. But the errors in the log I posted was when the printer module had stopped and an hour before that it was started. So make of that what you will.

When the printer module is stopped, printing doesn't work.

output of netstat -patun | grep 631
Code: [Select]
tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN      5519/cupsd
tcp6       0      0 :::631                  :::*                    LISTEN      5519/cupsd
This is while the printer module is started and functional. I assume you'd like to see this output when it is stopped so I'll have to wait for it to mess up again and post back.


Another error in the logs;
Code: [Select]
E [25/Jul/2014:09:42:44 -0400] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [25/Jul/2014:09:43:47 -0400] SSL shutdown failed: Error in the push function.

Ran the command netstat -patun | grep 631 after the printer module had stopped itself.
Nothing is outputted.

jgould

  • Zen Monk
  • **
  • Posts: 52
  • Karma: +6/-0
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #13 on: July 28, 2014, 02:24:20 pm »
Not sure whether this will help, but after I upgraded Zentyal from 3.4 to 3.5, cups would stop working every day because the logrotate configuration for cups was not creating the new cups log files with the correct permissions. I "fixed" by disabling logrotate for cups.

Unfortunately, I don't recall seeing those "address already in use" errors.

Thanks. I can give that a try. How exactly did you disable logrotate?

jgould

  • Zen Monk
  • **
  • Posts: 52
  • Karma: +6/-0
    • View Profile
Re: Printer sharing service always has to be restarted (Zentyal 3.4)
« Reply #14 on: July 29, 2014, 03:44:00 pm »
So I think thefreeaccount is probably right and the issue is logrotate stopping cups so it can rotate the logs and it not restarting correctly.

I'm just not sure how best to handle this. I don't actually care about the logs right now as long as the module stays on. So what would be the best way to stop logrotate for cups only? I don't want my logs growing uncontrollably. I figure I could disable logging in the cupsd.conf file by changing it to none so the file doesn't grow out of control, although it would be nice to still have logging and have it still clean up the logs. To stop logrotate for cups only I'm not sure how to do that. If I remove the cups-deamon file from the logrotate.d folder then won't it just fall back on the logrotate.conf settings? Do I have to disable a cron job? I saw references for apache about using copytruncate to avoid restarting but not sure if that could work. I'm just not really sure the beat way to work around this. Any help?

Thanks.
« Last Edit: July 29, 2014, 03:45:38 pm by jgould »