# VERIFICATION: DISCO
- Using the reproducer defined in the test case and the version in -updates:

ubuntu@disco-sssd-ad:~$ dpkg -l | grep -E "cups-daemon| cups |cups-common"
ii  cups                              2.2.10-4                            amd64 
       Common UNIX Printing System(tm) - PPD/driver support, web interface
ii  cups-common                       2.2.10-4                            all   
       Common UNIX Printing System(tm) - common files
ii  cups-daemon                       2.2.10-4                            amd64 
       Common UNIX Printing System(tm) - daemon

ubuntu@disco-sssd-ad:~$ grep -i systemgroup /etc/cups/cups-files.conf 
SystemGroup lpadmins@TESTS.LOCAL
ubuntu@disco-sssd-ad:~$ systemd-analyze critical-chain cups.service
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

cups.service +161ms
└─cups.socket @46.229s
  └─sysinit.target @42.682s
    └─cloud-init.service @37.411s +5.239s
      └─systemd-networkd-wait-online.service @35.640s +1.727s
        └─systemd-networkd.service @35.419s +189ms
          └─network-pre.target @35.415s
            └─cloud-init-local.service @21.419s +13.992s
              └─systemd-remount-fs.service @7.277s +570ms
                └─systemd-journald.socket @7.070s
                  └─system.slice @6.915s
                    └─-.slice @6.915s

- After reboot, cups fails to start:

ubuntu@disco-sssd-ad:~$ systemctl status cups
● cups.service - CUPS Scheduler
   Loaded: loaded (/lib/systemd/system/cups.service; enabled; vendor preset: 
enabled)
   Active: failed (Result: exit-code) since Tue 2019-05-07 11:12:09 UTC; 16min 
ago
     Docs: man:cupsd(8)
  Process: 747 ExecStart=/usr/sbin/cupsd -l (code=exited, status=1/FAILURE)
 Main PID: 747 (code=exited, status=1/FAILURE)

May 07 11:12:09 disco-sssd-ad systemd[1]: Stopped CUPS Scheduler.
May 07 11:12:09 disco-sssd-ad systemd[1]: Started CUPS Scheduler.
May 07 11:12:09 disco-sssd-ad systemd[1]: cups.service: Main process exited, 
code=exited, status=1/FAILURE
May 07 11:12:09 disco-sssd-ad systemd[1]: cups.service: Failed with result 
'exit-code'.
May 07 11:12:09 disco-sssd-ad systemd[1]: cups.service: Service 
RestartSec=100ms expired, scheduling resta
May 07 11:12:09 disco-sssd-ad systemd[1]: cups.service: Scheduled restart job, 
restart counter is at 5.
May 07 11:12:09 disco-sssd-ad systemd[1]: Stopped CUPS Scheduler.
May 07 11:12:09 disco-sssd-ad systemd[1]: cups.service: Start request repeated 
too quickly.
May 07 11:12:09 disco-sssd-ad systemd[1]: cups.service: Failed with result 
'exit-code'.
May 07 11:12:09 disco-sssd-ad systemd[1]: Failed to start CUPS Scheduler.

ubuntu@disco-sssd-ad:~$ grep cupsd /var/log/syslog | grep -v kernel
May  7 11:12:10 disco-sssd-ad cupsd[692]: Unknown SystemGroup 
"lpadmins@TESTS.LOCAL" on line 19 of /etc/cups/cups-files.conf.
May  7 11:12:10 disco-sssd-ad cupsd[692]: Unable to read 
"/etc/cups/cups-files.conf" due to errors.
May  7 11:12:10 disco-sssd-ad cupsd[721]: Unknown SystemGroup 
"lpadmins@TESTS.LOCAL" on line 19 of /etc/cups/cups-files.conf.
...


- Using the version in -proposed, after rebooting, cups works fine:

ubuntu@disco-sssd-ad:~$ dpkg -l | grep -E "cups-daemon| cups |cups-common"
ii  cups                              2.2.10-4ubuntu1                     amd64 
       Common UNIX Printing System(tm) - PPD/driver support, web interface
ii  cups-common                       2.2.10-4ubuntu1                     all   
       Common UNIX Printing System(tm) - common files
ii  cups-daemon                       2.2.10-4ubuntu1                     amd64 
       Common UNIX Printing System(tm) - daemon

ubuntu@disco-sssd-ad:~$ systemctl status cups
● cups.service - CUPS Scheduler
   Loaded: loaded (/lib/systemd/system/cups.service; enabled; vendor preset: 
enabled)
   Active: active (running) since Tue 2019-05-07 11:32:52 UTC; 33s ago
     Docs: man:cupsd(8)
 Main PID: 812 (cupsd)
    Tasks: 1 (limit: 2356)
   Memory: 2.5M
   CGroup: /system.slice/cups.service
           └─812 /usr/sbin/cupsd -l

May 07 11:32:52 disco-sssd-ad systemd[1]: Started CUPS Scheduler.
ubuntu@disco-sssd-ad:~$ systemd-analyze critical-chain cups.service
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

cups.service @49.422s
└─sssd.service @41.473s +7.943s
  └─basic.target @41.321s
    └─sockets.target @41.318s
      └─snapd.socket @41.111s +184ms
        └─sysinit.target @40.800s
          └─cloud-init.service @37.899s +2.895s
            └─systemd-networkd-wait-online.service @36.713s +1.141s
              └─systemd-networkd.service @36.346s +360ms
                └─network-pre.target @36.341s
                  └─cloud-init-local.service @21.748s +14.588s
                    └─systemd-remount-fs.service @8.932s +140ms
                      └─systemd-journald.socket @8.844s
                        └─-.mount @8.477s
                          └─systemd-journald.socket @8.844s
                            └─...


- Using the version in -proposed, with sssd not installed in the machine (and 
setting SystemGroup to the original local group "lpadmin"), cups still starts:

ubuntu@disco-sssd-ad:~$ systemctl status cups
● cups.service - CUPS Scheduler
   Loaded: loaded (/lib/systemd/system/cups.service; enabled; vendor preset: 
enabled)
   Active: active (running) since Tue 2019-05-07 11:38:26 UTC; 4min 17s ago
     Docs: man:cupsd(8)
 Main PID: 682 (cupsd)
    Tasks: 1 (limit: 2356)
   Memory: 4.0M
   CGroup: /system.slice/cups.service
           └─682 /usr/sbin/cupsd -l

May 07 11:38:26 disco-sssd-ad systemd[1]: Started CUPS Scheduler.

ubuntu@disco-sssd-ad:~$ systemd-analyze critical-chain cups.service
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

cups.service @27.716s
└─basic.target @27.601s
  └─sockets.target @27.598s
    └─snapd.socket @27.473s +122ms
      └─sysinit.target @27.373s
        └─cloud-init.service @24.965s +2.315s
          └─systemd-networkd-wait-online.service @23.048s +1.865s
            └─systemd-networkd.service @22.857s +160ms
              └─network-pre.target @22.847s
                └─cloud-init-local.service @12.658s +10.184s
                  └─systemd-remount-fs.service @5.088s +163ms
                    └─systemd-journald.socket @5.020s
                      └─-.mount @4.934s
                        └─systemd-journald.socket @5.020s
                          └─...

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to cups in Ubuntu.
https://bugs.launchpad.net/bugs/1822062

Title:
  Race condition on boot between cups and sssd

Status in cups package in Ubuntu:
  Fix Released
Status in cups source package in Xenial:
  Fix Committed
Status in cups source package in Bionic:
  Fix Committed
Status in cups source package in Cosmic:
  Fix Committed
Status in cups source package in Disco:
  Fix Committed
Status in cups source package in Eoan:
  Fix Released

Bug description:
  [Impact]

   * When cups has set the "SystemGroup" directive to an external group
  provided through sss and cups starts before sssd has finished booting,
  cups will crash because the group does not exist.

   * The patch adds an "After=sssd.service" clause to the service unit
  file.

  [Test Case]

   * Configure an external authentication service (LDAP, AD...) and
  create a group, for instance "lpadmins@tests.local"

   * Set SystemGroup to match that group in /etc/cups/cups-files.conf:
  SystemGroup lpadmins@tests.local

   * Reboot

   * If cups has started before sssd has finished booting, cups will crash:
  Mar 27 10:10:33 cups-sssd cupsd[21463]: Unknown SystemGroup 
"lpadmins@tests.local" on line 19 of /etc/cups/cups-files.conf.

   * If cups starts after sssd, it will work fine.

  [Regression Potential]

   * Minimal: this patch affects just the ordering of the service unit
  file.

  [Other Info]

   * Upstream:
  https://github.com/apple/cups/commit/4d0f1959a3f46973caec2cd41828c59674fe195d

  [Original description]

  When cups has set the "SystemGroup" directive to an external group
  provided through sss and cups starts before sssd has finished booting,
  cups will crash because the group does not exist. For instance, with a
  group named lpadmins@tests.local served from Active Directory through
  sssd, if the sssd service hasn't booted before cups:

  Mar 27 10:10:33 cups-sssd systemd[1]: Started CUPS Scheduler.
  Mar 27 10:10:33 cups-sssd systemd[1]: Started CUPS Scheduler.
  Mar 27 10:10:33 cups-sssd systemd[1]: Started Make remote CUPS printers 
available locally.
  Mar 27 10:10:33 cups-sssd cupsd[21463]: Unknown SystemGroup 
"lpadmins@tests.local" on line 19 of /etc/cups/cups-files.conf.
  Mar 27 10:10:33 cups-sssd cupsd[21463]: Unable to read 
"/etc/cups/cups-files.conf" due to errors.
  Mar 27 10:10:33 cups-sssd systemd[1]: cups.service: Main process exited, 
code=exited, status=1/FAILURE
  Mar 27 10:10:33 cups-sssd systemd[1]: cups.service: Failed with result 
'exit-code'.
  Mar 27 10:10:33 cups-sssd systemd[1]: cups.service: Service hold-off time 
over, scheduling restart.
  Mar 27 10:10:33 cups-sssd systemd[1]: cups.service: Scheduled restart job, 
restart counter is at 2.
  Mar 27 10:10:33 cups-sssd systemd[1]: Stopping Make remote CUPS printers 
available locally...
  Mar 27 10:10:33 cups-sssd systemd[1]: Stopped Make remote CUPS printers 
available locally.
  Mar 27 10:10:33 cups-sssd systemd[1]: Stopped CUPS Scheduler.

  If sssd is running before cups starts, everything works as expected.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1822062/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to