race condition on startup between samba and cups
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| samba (Ubuntu) |
High
|
James Page | ||
| Precise |
High
|
Unassigned | ||
| Quantal |
High
|
James Page |
Bug Description
As seen in bug 967410 is possible for cups to start after smbd - if samba is configured to retrieve printer information from cups it fails and printers are not automatically configured.
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: samba (not installed)
ProcVersionSign
Uname: Linux 3.5.0-13-generic x86_64
ApportVersion: 2.5.1-0ubuntu4
Architecture: amd64
Date: Fri Sep 7 10:58:35 2012
SambaServerRegr
SmbConfIncluded: Yes
SourcePackage: samba
UbuntuFailedCon
UpgradeStatus: Upgraded to quantal on 2012-06-11 (88 days ago)
Related branches
- Steve Langasek: Needs Fixing on 2012-09-12
-
Diff: 49 lines (+22/-4)3 files modifieddebian/changelog (+10/-0)
debian/samba.reload-smbd.conf (+12/-0)
debian/samba.smbd.upstart (+0/-4)
James Page (james-page) wrote : | #1 |
Changed in samba (Ubuntu Precise): | |
importance: | Undecided → High |
Changed in samba (Ubuntu Quantal): | |
importance: | Undecided → High |
Changed in samba (Ubuntu Precise): | |
status: | New → Triaged |
Changed in samba (Ubuntu Quantal): | |
status: | New → In Progress |
assignee: | nobody → James Page (james-page) |
Launchpad Janitor (janitor) wrote : | #2 |
Changed in samba (Ubuntu Quantal): | |
status: | In Progress → Fix Released |
James Page (james-page) wrote : | #3 |
The output of:
sudo testparm -s
Would also be useful - please obfuscate any sensitive information first.
Thanks
Steve Langasek (vorlon) wrote : | #4 |
Hi James,
if status cups >/dev/null ; then
fi
This solution has the effect that if the cups job is broken for any reason, smbd will also not be started. I don't think that's desirable.
We've tried hard in the past to ensure samba is *not* dependent on cups being present before samba starts. I think this would be better done as a job in the samba package which is 'start on started cups' and will prompt samba to reload its config.
James Page (james-page) wrote : Re: [Bug 1047262] Re: race condition on startup between samba and cups | #5 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi Steve
On 07/09/12 16:36, Steve Langasek wrote:
> Hi James,
>
> if status cups >/dev/null ; then start wait-for-state WAITER=smbd
> WAIT_FOR=cups WAIT_STATE=running fi
>
> This solution has the effect that if the cups job is broken for
> any reason, smbd will also not be started. I don't think that's
> desirable.
>
> We've tried hard in the past to ensure samba is *not* dependent on
> cups being present before samba starts. I think this would be
> better done as a job in the samba package which is 'start on
> started cups' and will prompt samba to reload its config.
I'd not considered doing it that way - it would de-couple samba
startup from cups which I agree is preferable - I'll take a look and
do the rework early next week.
Thanks for the feedback.
- --
James Page
Ubuntu Core Developer
Debian Maintainer
<email address hidden>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iQIcBAEBCAAGBQJ
HFE5Jl2r2P1iPah
yfWiCrcaxdqV7mc
vIZ7bSPcriLOeii
xJClo+ir22+
RqZQeTeYRabJWRC
EDv8BKVzrgdrhu3
o1xA0Ktb/
1sWuWD/
CBC7ySepaxTKr+
MPAIIAHdBsm5HCJ
DDsrEsfaU6ByjWd
=233E
-----END PGP SIGNATURE-----
James Page (james-page) wrote : | #6 |
@Steve
I've proposed a branch with a separate job to complete the reload post start of cups.
Your review would be appreciated.
Changed in samba (Ubuntu Quantal): | |
status: | Fix Released → Triaged |
Changed in samba (Ubuntu Quantal): | |
status: | Triaged → In Progress |
Launchpad Janitor (janitor) wrote : | #7 |
This bug was fixed in the package samba - 2:3.6.6-3ubuntu3
---------------
samba (2:3.6.6-3ubuntu3) quantal; urgency=low
* Decouple startup of smbd from cups (LP: #1047262):
- d/samba.
- d/samba.
once cups has started, ensuring that smbd startup is decoupled
from cups.
- d/rules: Install reload-smbd upstart configuration, don't try to
start on install.
* Install winbind upstart configuration file with --upstart-only option
for consistency with samba package.
-- James Page <email address hidden> Wed, 12 Sep 2012 13:24:16 +0100
Changed in samba (Ubuntu Quantal): | |
status: | In Progress → Fix Released |
Steve Langasek (vorlon) wrote : | #8 |
>* Install winbind upstart configuration file with --upstart-only option
> for consistency with samba package.
Heh, this part is a wrong change. The upstart-only flag is for upstart jobs which aren't replacing init scripts of the same name.
Brett Keller (blkeller) wrote : | #9 |
Are there any plans to fix this issue in Precise now that Quantal has a working patch? Thanks.
Ryan Tandy (rtandy) wrote : | #10 |
I tried the reload-smbd job on Precise but it doesn't work. The job is definitely started after cups but the queues still aren't there. Works fine in Quantal.
Running 'start smbd; start cups; reload smbd' while the system is running does work, and adding a 'sleep 1' to reload.smbd.conf also works, so I guess having this work properly depends on some other change (in cups, possibly? forking too soon?).
I was going to propose an SRU with just the reload-smbd.conf from Quantal but it's looking more complicated than that. Any ideas?
This bug was fixed in the package samba - 2:3.6.6-3ubuntu2
---------------
samba (2:3.6.6-3ubuntu2) quantal; urgency=low
* Ensure samba can query cups for printer information on startup smbd.upstart: Optionally wait for cups to be in state
(LP: #1047262):
- d/samba.
'running' if cups is installed.
-- James Page <email address hidden> Fri, 07 Sep 2012 10:58:08 +0100