CUPS starts after SAMBA; printers are not available (convert cups to upstart)

Bug #494141 reported by immortel
266
This bug affects 53 people
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
Fix Released
Undecided
Martin Pitt
Declined for Karmic by Mathias Gug
Lucid
Won't Fix
Medium
Clint Byrum
samba (Ubuntu)
Invalid
High
Unassigned
Declined for Karmic by Mathias Gug
Lucid
Invalid
High
Unassigned
upstart (Ubuntu)
Invalid
Undecided
Unassigned
Declined for Karmic by Mathias Gug
Lucid
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: cups

When I boot my computer, Samba is trying to connect on CUPS but it can't because it's not started yet. Samba timeout connecting on CUPS before this last one is completely started.

I've be able to workaround this issue by modifying the startup order:
sudo mv /etc/rc2.d/S50cups /etc/rc2.d/S15cups

Since it is working fine but a bit worry on the next update of cups. How will it react in rc2.d.

Could you make a permanent fix for this?

Regards

ProblemType: Bug
Architecture: i386
CupsErrorLog:

Date: Tue Dec 8 13:48:50 2009
DistroRelease: Ubuntu 9.10
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
Lpstat: device for E210: usb://Lexmark/E210
Lsusb:
 Bus 001 Device 005: ID 0bda:0111 Realtek Semiconductor Corp. Card Reader
 Bus 001 Device 004: ID 15a9:0004
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 002 Device 002: ID 046d:c512 Logitech, Inc. LX-700 Cordless Desktop Receiver
 Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: HP-Pavilion GX615AA-A2L s3300f
NonfreeKernelModules: nvidia
Package: cups 1.4.1-5ubuntu2.1
Papersize: letter
PpdFiles: E210: Lexmark E210 Foomatic/gdi (recommended)
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.31-16-generic root=UUID=42d59fe9-7859-4479-a717-ce06164ea3bf ro quiet splash
ProcEnviron:
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-16.52-generic
SourcePackage: cups
Uname: Linux 2.6.31-16-generic i686
dmi.bios.date: 11/14/2007
dmi.bios.vendor: Phoenix Technologies, LTD
dmi.bios.version: 5.09
dmi.board.name: Acacia
dmi.board.vendor: ASUSTek Computer INC.
dmi.board.version: 1.02
dmi.chassis.type: 3
dmi.chassis.vendor: Hewlett-Packard
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnPhoenixTechnologies,LTD:bvr5.09:bd11/14/2007:svnHP-Pavilion:pnGX615AA-A2Ls3300f:pvr:rvnASUSTekComputerINC.:rnAcacia:rvr1.02:cvnHewlett-Packard:ct3:cvrChassisVersion:
dmi.product.name: GX615AA-A2L s3300f
dmi.sys.vendor: HP-Pavilion

Revision history for this message
immortel (immortel32) wrote :
Revision history for this message
floid (jkanowitz) wrote :

Bingo, this is the bug I've been looking for.

While I've seen some bugs and forum posts regarding insserv getting called upon installation of various packages and failing, I haven't caught anything automatically running insserv at all. *That* would seem to be the problem, as investigating a system here, /etc/init.d/cups already contains the lines:

# X-Start-Before: samba
# X-Stop-After: samba

...

I failed to notice that on a machine where this was actually a problem, and thus [also] added cups to /etc/init.d/samba:

# Required-Start: $network $local_fs $remote_fs cups

...before realizing I had to actually run insserv myself, which promptly reordered everything properly based on those directives.

I haven't looked at a roadmap, but I sure hope all of these "base" packages will be updated with "native" upstart scripts for Lucid / 10.04; living with both the new and legacy systems just makes everything twice as complicated, and if it doesn't get done for the LTS, nobody's going to want to 'break' the LTS [or worse, it'll get 'broken' later on if scripts are suddenly backported/packages updated to include them]. Better to make the push now, then it should be all sorted out by release-candidate time.

Revision history for this message
Francesco Pretto (ceztko) wrote :

2 problems here:

- cups is still an old sysvinit script;
- samba is an upstart job but doesn't have any dependencies on cups.

Moreover I think it's the samba upstart job that should assert "start after cups", and not cups to worry about starting before samba. So for sure this actually a deficiency in the samba upstart job. Not clear to me if it can be solved before cups becomes an upstart job too.

If you want a temporary workaround, put a:

sleep 10

just after "pre start script" in /etc/init/smbd.conf.

Actually, I needed to put the same waiting time in /etc/init/nmbd.conf otherwise the master domain browser was nonfunctional, so it seems there are some dependencies nmbd <-> smbd (don't know the correct verse) unsatisfied.

Revision history for this message
Chuck Short (zulcss) wrote :

Not really a samba bug, its a cups bug.

chuck

Changed in samba (Ubuntu):
status: New → Invalid
Revision history for this message
Francesco Pretto (ceztko) wrote :

Just to be clear, what is exactly the cups bug (other than not being an upstart job yet)? I don't know if upstart already have stanzas like "start before/after" (because it's clear that samba is not really dependent on cups, but if present cups should be started before samba), but it seems more easy to me for samba to say something like "start after cups" than cups keeping an updated list of services it should start before.

Revision history for this message
Francesco Pretto (ceztko) wrote :

Or maybe is a problem in cups not promptly giving a dynamic list of printers available runtime? Sorry, but there were no explanation and I was curious about this. :)

Revision history for this message
immortel (immortel32) wrote :

The problem is the following:

When I boot up my computer and CUPS starts after Samba, I cannot get the list of my "shared" printer. I need CUPS to start first and then Samba.

Is it a CUPS bug or a Samba bug??? I have no clue. It is a bug.

As I stated, I found a workaround (sudo mv /etc/rc2.d/S50cups /etc/rc2.d/S15cups) but it would be nice if it could be fixed in the version 10.04 (I seriously doubt it). :)

Revision history for this message
Phil Salkie (phil-asylumhouse) wrote :

I see this problem in Kubuntu Karmic as well. I've worked around it by adding "/etc/init.d/samba reload" to /etc/rc.local, since I'm not sure if there's a valid reason to start Samba way before CUPS. Probably adding a check at the end of the CUPS startup script to see if "smbd" is running, and if so then tell samba to reload would also have fixed things nicely.

Revision history for this message
DerDeus (kud11) wrote :

Hi,

I have the same problem too. I solved it by adding

sleep 60
restart smbd

to /etc/rc.local.

I think the problem is samba starting before cups :-(

System: Ubuntu 10.04

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

This is a problem of upstart. upstart must also handle dependencies between services correctly if some services are natively started by upstart and others by legacy init scripts.

Changed in cups (Ubuntu):
status: New → Invalid
Changed in cups (Ubuntu Lucid):
status: New → Invalid
Changed in samba (Ubuntu Lucid):
status: New → Invalid
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Not it must not.

If you want to depend on a service using Upstart, you MUST convert your init script to an Upstart job.

Changed in upstart (Ubuntu):
status: New → Invalid
Changed in upstart (Ubuntu Lucid):
status: New → Invalid
Changed in cups (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

re-opening CUPS task, the bug here is that CUPS is still using an init script when it should be converted to an Upstart job

Revision history for this message
Peter (pry) wrote :

Have to agree. The bug is here on my server too and it's very annoying!

Changed in upstart (Ubuntu Lucid):
status: Invalid → Confirmed
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

PryGuy: please don't mess with the bug status, it's as it should be - there is an open task on CUPS

Changed in upstart (Ubuntu Lucid):
status: Confirmed → Invalid
Revision history for this message
Peter (pry) wrote : Re: [Bug 494141] Re: CUPS starts after SAMBA; printers are not available

I'm all sorry, this was a mistake. I'm really surprised an ordinary user can change it. Sorry again.

Revision history for this message
Francesco Pretto (ceztko) wrote : Re: [Bug 494141] Re: CUPS starts after SAMBA; printers are not available

2010/5/20 PryGuy <email address hidden>:
> I'm all sorry, this was a mistake. I'm really surprised an ordinary user
> can change it. Sorry again.
>

(OT)
Hehehe, actually Launchpad works better than others BTS because gives
more freedom to users. If you did a mistake, don't worry but be more
careful next time :)

Revision history for this message
Jan Rathmann (kaiserclaudius) wrote : Re: CUPS starts after SAMBA; printers are not available

This issue is still present in Lucid.
Another way to work around it is to modify the /etc/init/smd.conf upstart job with a kind of "ugly hack" that makes Samba wait for cups (see attached file).

Revision history for this message
Dmitriy Balakin (0x0000.ru) wrote :

Another solution, the pure upstart way. Modify the one line in /etc/init/smb.conf as follows:

start on (local-filesystems and stopped rc)

The bootchart confirms that now is smbd starts after cups.

tags: added: patch
Revision history for this message
James D (demichej) wrote :

Tada! You rock. That fix is perfect, ship it.

Revision history for this message
Sergio (sds012002) wrote :

When I try to connect to smb printer Windows says: Error 66

if I restart smbd service, shared printer start to share.

Can You tell us a fix?

Revision history for this message
Krzysztof Matusik (krzysztof-matusik) wrote :

This bug also affects me

It would be easily solved if CUPS has converted to upstart.

Please get interested into solving https://bugs.launchpad.net/ubuntu/+source/cups/+bug/520497

summary: - CUPS starts after SAMBA; printers are not available
+ CUPS starts after SAMBA; printers are not available (convert cups to
+ upstart)
Revision history for this message
cob (cobbjbc) wrote :

This bug affects a server I maintain as well. No one can print to a shared printer following a reboot. I have added the workaround to reload samba in rc.local, but would like to see someone assigned to this bug. Can we please have the importance upgraded?

Revision history for this message
enternamo (enternamo) wrote :

We have the same problem in our business environment at the place I work at. I think this is an upstart problem as how can samba connect to an existing cups server when it hasn't started yet. Samba needs to depend on cups.

Revision history for this message
antonioni (antonioni-rocha) wrote :

Does this problem still open?

Revision history for this message
peterthevicar (peterthevicar) wrote :

Mam(O)n's solution (#18) of modifying the 'start' line in /etc/init/smbd.conf to say

start on (local-filesystems and stopped rc)

worked for me, no other changes necessary. Thank you!

Changed in samba (Ubuntu):
status: Invalid → Triaged
Changed in samba (Ubuntu Lucid):
status: Invalid → Triaged
importance: Undecided → High
Changed in samba (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-10.10
Changed in samba (Ubuntu Lucid):
milestone: none → lucid-updates
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The problem can very easily be solved for Maverick and Lucid LTS (SRU) by applying the solution presented in comment #18. This is especially the best method now as we are past Feature Freeze and so a switchover of CUPS to native Upstart is only possible for Natty. Especially important is also the SRU for Lucid, as LTS versions are preferably used for servers. So I am very grateful if the Samba maintainers could apply this simple patch.

Revision history for this message
Steve Langasek (vorlon) wrote :

Potential issues with the proposed patch:

  - this is a workaround in the smbd job, not a correct fix, which will need to be reverted later.
  - in the (rare) event that a user has stopped smbd manually and then changes runlevels, current upstart will give a weird hang waiting for a second local-filesystems event.
  - if someone has configured a loopback cifs share to be mounted at boot time, their system will hang at boot as a result of this change.

So there is regression potential here from the described change to the smbd job, and I'm not really in favor of this approach. Why has the cups package now gone more than two cycles without being converted to an upstart job, which would fix this properly? Also, why does samba not re-scan for a cups server? That seems like unnecessarily unreliable behavior on samba's part, and something that should be straightforward to fix correctly (and suitable for an SRU).

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

pitti has upstartified CUPS now for the Maverick package. CUPS by itself works nicely with upstart, also on a system boot CUPS and Samba get started in the correct order. There is still fine tuning needed so that Samba does not hang when manually starting and stopping the CUPS and Samba services.

Changed in cups (Ubuntu):
status: Confirmed → In Progress
milestone: none → ubuntu-10.10
Revision history for this message
Martin Pitt (pitti) wrote :

cups (1.4.4-5) unstable; urgency=low

  [ Martin Pitt ]
  * ubuntu-upstart.dpatch: Drop the dependency "on starting smbd", it causes
    samba to hang on package upgrades or manual restarts. There doesn't seem
    to be a good way to express this dependency right now. (LP: #639768)
    Instead, send a SIGHUP to smbd if it is running, which causes it to reload
    printers.

  [ Till Kamppeter ]
  * pstops-based-workflow-only-for-printing-ps-on-a-ps-printer.dpatch:
    Let CUPS use the former PostScript-based filter chain only if the input
    file is PostScript and the printer is a PostScript printer with
    manufacturer-supplied PPD file. This avoids ugly PS->PDF->PS conversions
    which are bad for the performance and sometimes cause issues
    (Closes: #593338, requested by Ricoh).

 -- Martin Pitt <email address hidden> Thu, 16 Sep 2010 18:57:06 +0200

Changed in cups (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: In Progress → Fix Released
Changed in samba (Ubuntu Lucid):
status: Triaged → Invalid
Changed in samba (Ubuntu):
milestone: ubuntu-10.10 → none
status: Triaged → Invalid
Changed in samba (Ubuntu Lucid):
milestone: lucid-updates → none
Changed in cups (Ubuntu Lucid):
status: Invalid → Won't Fix
Revision history for this message
Martin Pitt (pitti) wrote :

For lucid, Jelmer says that samba reloads the printers every 750 seconds anyway, so it's just a matter of waiting. Changing the cups init script to an upstart job is not an appropriate SRU.

Revision history for this message
Francesco Pretto (ceztko) wrote : Re: [Bug 494141] Re: CUPS starts after SAMBA; printers are not available (convert cups to upstart)

2010/9/17 Martin Pitt <email address hidden>:
> cups (1.4.4-5) unstable; urgency=low
>
>  [ Martin Pitt ]
>  * ubuntu-upstart.dpatch: Drop the dependency "on starting smbd", it causes
>    samba to hang on package upgrades or manual restarts. There doesn't seem
>    to be a good way to express this dependency right now. (LP: #639768)

Is Scott (maintainer of upstart) aware of this?

Revision history for this message
Lucio M Nicolosi (lmnicolosi) wrote :

Running AMD64 Maverick Beta 2010, 7 Oct. with all updates. This bug is still present. At least in this recent Maverick clean install (where I didn't apply the patch referred at #18) there's no "samba reloading the printers every 750 seconds" as stated at #30. Are there any Cups/Samba updates still to be released before Oct. 10?

Revision history for this message
malheum (maxheise) wrote :

I can confirm this bug on 10.04 LTS fully updated as of today.

I must say that it is really a snafu to have a server without any printers available via samba to clients when it boots.

And there was no reload every 750secs as stated somewhere above. The server boots, printers are available locally via cups, but not via samba and an hour later the situation is still the same.

Revision history for this message
tomasz kubacki (tomasz-kubacki) wrote :

as of today on my 10.10 bug is still present (appling patch from #18 works)

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Anyone who has still problems on Maverick, please attach your /etc/init/cups.conf file.

Revision history for this message
Matt Burkhardt (matthewboh) wrote :

I've been running Ubuntu LTS Versions since 6.06 and doing the upgrades. I'm currently at 10.04 and I've got this exact same problem.

I've tried adding in the fix listed in Comments #18 and #25 (the same fix), but that doesn't work at all - meaning Samba does not load at all and running smbtree gives me nothing.

I have also tried putting the /etc/rc2.d/S50cups and move it to S05cups - but still doesn't work.

I'm not sending the cups.conf file because I'm not on Maverick and it runs just fine if I stop and start cups then smbd

Samba has been running fine with CUPS the last 3 1/2 years on that box with all the LTS updates applied and this last set broke a couple of things - but mostly CUPS / XSANE related. Any help or pointers appreciated

Revision history for this message
fermo111 (fermo111) wrote :

Patch #18 does not work for me on 10.04

Revision history for this message
Lucio M Nicolosi (lmnicolosi) wrote :

Here my cups.conf file. Bug still present in Maverick 64 updated till Dec 12, 2010.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Can everyone with problems please also post /etc/cups/cupsd.conf and /etc/samba/smb.conf? Please attach the files one after the other, do not compress them.

Revision history for this message
Ian McMichael (ian-sigma-uk) wrote :
Revision history for this message
Ian McMichael (ian-sigma-uk) wrote :

Sorry for the two posts, I couldn't work out how to attach more than one file to a comment! cupsd.conf and smb.conf as requested. IP addresses and domain names have been changed as per RFC1166 and RFC2606 respectively to protect privacy.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Ian, thank you for your files. For me the configurations look correct. Can perhaps look a Samba expert into them?

Revision history for this message
Nec (nicolas-ecarnot) wrote :

Hi,

Thank you on comment #18 for the answer, but when trying to understand what was best to do, I tried that instead:

start on (local-filesystems and started cups)

and :
- it IS working
- this is best understandable

What comes smbd should wait for something else than cups to solve *this* issue?

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

There's a way to do this in lucid without modifying samba at all.

# cups-sysv

start on starting smbd
stop on stopped smbd

pre-start script
  invoke-rc.d cups start || :
end script

post-stop script
  invoke-rc.d cups stop || :
end script
#EOF

This will ensure that cups is started before smbd. It will also introduce an error when we try to start/stop it again during rc2.d .. but that shouldn't be more than a nuisance (and we could always remove it from rc2.d in this pre-start)

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Another even simpler thing to do would be to just add a 'service smbd reload' to the start action of the init script.

Changed in cups (Ubuntu Lucid):
status: Won't Fix → Triaged
assignee: nobody → Clint Byrum (clint-fewbar)
importance: Undecided → Medium
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Ok I uploaded a package to lucid-proposed that reloads samba after start. I tested it with both cups and samba installed, and with samba never installed, removed and purged.

Revision history for this message
Lucio M Nicolosi (lmnicolosi) wrote :

re: #45

This bug was reported on 2009-12-08.

At last some common sense at work. Hope it is also uploaded for Maverick.

Thanks, Clint Byrum.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Excerpts from Lucio M Nicolosi's message of Mon Apr 04 19:36:42 UTC 2011:
> re: #45
>
> This bug was reported on 2009-12-08.
>
> At last some common sense at work. Hope it is also uploaded for
> Maverick.

Lucio, maverick should not be affected because the cups upstart job
reloads samba in its post-start, much like the changes to the lucid
init.d script does.

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted cups into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in cups (Ubuntu Lucid):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Lucio M Nicolosi (lmnicolosi) wrote :

Re #48

Clint, every time I have to restart Maverick 64 (hopefully seldon) I subsequently run "sudo service smbd restart" (too lazy and ignorant to put it on a script) because printers will not load in Samba. Can't remember if I had too do it on Lucid. Will try to leave the system alone for a few hours and see what happens but the last time I did it, I could not observe what Martin stated at #30 (samba reloads the printers every 750 seconds) by the way (can' help but notice), already commented at #32 on Oct, 2010. Could it be something with my config? This is a Mav. 64 clean install, no leftovers from Lucid (besides /home).

Revision history for this message
Lucio M Nicolosi (lmnicolosi) wrote :

System is on now for one hour (3600 secs) after a restart and no signal of a "Samba reload" as stated at #30. smbclient -L [..] correctly shows all shares but the printers. Either the same bug exists in Maverick 64 or a similar bug affects at least my system. Anything I could do besides "sudo service smbd start"?

Revision history for this message
Lucio M Nicolosi (lmnicolosi) wrote :

Although the default smb.conf parameter "printing" equals to "cups" (printing = cups) unless the parameter "printcap name" is set (printcap name = cups) the printers do not load in the periodical "samba reload" process referred at #30, thus requiring a manual "sudo service smbd restart".

Since I try to keep my smb.conf as lean as possible, trying to keep the defaults, I didn't notice this up to some minutes ago when checked the smb.conf file at #42. My fault, sorry, feel really ashamed, but if one day someone arrives here looking for a solution for this bug while riding a Maverick or Natty my mistake can be useful.

So Martin Pitt was right, in Maverick and (by the way) Natty, although CUPS isn't available at samba startup, and this is a nuisance, it is automatically reloaded according to the "printcap cache time" parameter which defaults to 750, (too much for me, reduced to 300 or five minutes "printcap cache time = 300") providing you set "printcap name = cups" which, at the original smb.conf, looks like default but isn't...

Revision history for this message
Lucio M Nicolosi (lmnicolosi) wrote :

Re: #52
It seems I was wrong again. It looks like the printers were loaded when I saved the smb.conf file, which of course restarts the service. Left alone, Samba, in my Maverick AMD64, will not periodically reload the printers and I still don't know why.

Revision history for this message
ubuntuforum-bisi (ubuntuforum-bisi) wrote :

re #44,45,46

Apologies in advance if I've mis-understood the interactions here.

Can you please post the preferred workaround?

I have this exact issue in a fully-patched lucid (10.04.2) deployment that has already chewed up hours of my time over the past week. It started with VMware ws7 not being able to use a 2nd PCI parallel port, which, after my dis-belief passed, pushed me to kludge it with samba and cups and raw print queues, only to find this bug (after 3 or 4 cold starts to confirm yet another WTF?! moment). All I really want is for smbd to start after cups, in a way that won't come back and bite me in the [ah] when the packages get updated in the future (at a remote client site)

I don't plan to test the proposed patch as described in #49, since this machine is going into production ASAP (see comments about hours of time invested over a week)

Revision history for this message
John Edwards (john-cornerstonelinux) wrote :

derekshow, have you tried adding '/sbin/reload smbd' at the end of /etc/rc.local ?

That does not restart the Samba smbd processes, but does force them to reload their configuration - including asking CUPS for a list of printers.

Revision history for this message
ubuntuforum-bisi (ubuntuforum-bisi) wrote :

yes. I just did this in the interval between my last post and now. I was hoping for something with a little error-checking (rc.local always returns 0)

for others, here's the actual contents of /etc/rc.local

Revision history for this message
John Edwards (john-cornerstonelinux) wrote :

derekshaw, you do not need to *restart* smbd, only *reload* it.

And it is best to give the full path to the program in case the shell you are using has not automatically added /sbin to your $PATH variable.

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: [Bug 494141] Re: CUPS starts after SAMBA; printers are not available (convert cups to upstart)

Excerpts from derekshaw's message of Fri Apr 15 14:18:17 UTC 2011:
> re #44,45,46
>
> Apologies in advance if I've mis-understood the interactions here.
>
> Can you please post the preferred workaround?
>
> I have this exact issue in a fully-patched lucid (10.04.2) deployment
> that has already chewed up hours of my time over the past week. It
> started with VMware ws7 not being able to use a 2nd PCI parallel port,
> which, after my dis-belief passed, pushed me to kludge it with samba and
> cups and raw print queues, only to find this bug (after 3 or 4 cold
> starts to confirm yet another WTF?! moment). All I really want is for
> smbd to start after cups, in a way that won't come back and bite me in
> the [ah] when the packages get updated in the future (at a remote client
> site)
>
> I don't plan to test the proposed patch as described in #49, since this
> machine is going into production ASAP (see comments about hours of time
> invested over a week)

Derek, the change in the -proposed package implements the workaround
others are suggesting, though it does it in the package, rather than
rc.local.

If somebody is willing to try out the -proposed package, and let us know
here, we can allow it into -updates so all users will get it. You don't
need to be affected by the bug to try it out, just follow the test case
on a clean lucid VM (you can just configure a printer that doesn't exist)

Revision history for this message
Alfred (alfred-egger) wrote :

This problem still exists in 11.04 Natty Narwhal.

Revision history for this message
fabrizio (fabrizio-rinalduzzi) wrote :

On a 11.04 Natty Narwhal box I want to use as a :
- DHCP server
- NAS
- Printer Server

where all clients are Xp Pro based, I run into this "samba starts before cups" issue and I read all the previous comments.
I also gave a quick look to Upstart pages.

I did this stupid thing in /etc/init/smbd.conf :

start on( local-filesystems and started cups)

It works on my ubuntu box, perhaps this is a nice case of "beginner luck" but I do hope it helps others to solve their problems.

Damn ! I see that this was done in #43 by Nec. Ok nevertheless take it as a further confirmation.

Revision history for this message
Yrogirg (sargrigory-deactivatedaccount) wrote :

Yes, the bug is still in 11.04

Changed in cups (Ubuntu Lucid):
milestone: none → ubuntu-10.04.3
Revision history for this message
berry (berryme) wrote :

Very frustrating until I saw this post. Confrimed for me in 11.04. My machine had had very high uptimes so I did not notice until my UPS went recently and I would loose printers on reboots.
I was blindly hacking my smb.conf until this post.
rc.local with /sbin/reload smbd is my workaround

Revision history for this message
Kirill Elagin (kirelagin) wrote :

I confirm this in Ubuntu Server 11.04.
It's very strange that this bug exists for so long.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Kiril and/or berry, can you open a new bug report? This has been marked as Fix Released since Ubuntu 10.10, so if the SIGHUP after startup solution isn't working, then we have a regression.

Just run 'ubuntu-bug cups' and it will collect information from your systems. Make sure to come back to this bug report and let us know what bug#'s you've opened so we can investigate this regression.

Revision history for this message
Lucio M Nicolosi (lmnicolosi) wrote :

@ Clint,

A long time ago I also reported this bug for Maverick 64. Others reported for Natty an now Oneiric. Tired of waiting for a solution, successfully applied the patch explained at #18 to both my Mav and Natty installs. Wouldn't be easier to acknowledge that this bug isn't fixed at all than opening a new thread?

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Excerpts from Lucio M Nicolosi's message of Fri Sep 02 18:25:19 UTC 2011:
> @ Clint,
>
> A long time ago I also reported this bug for Maverick 64. Others
> reported for Natty an now Oneiric. Tired of waiting for a solution,
> successfully applied the patch explained at #18 to both my Mav and Natty
> installs. Wouldn't be easier to acknowledge that this bug isn't fixed
> at all than opening a new thread?
>

First, Thanks for sticking with us Lucio! I know it can be frustrating
when something just isn't working the way you'd expect it to.

There is a lot of noise attached to this, and it was indeed fixed at
one point by the developer. What has happened is likely a regression,
or even possibly an entirely different set of circumstances that lead
to the same bad end.

We may find that the original fix never took, but your extra bug reports
with versions and descriptions will help us nail down how this slipped
through and hopefully help to prevent the problem from recurring.

There's no reason to get attached to this particular bug report at all.
I know its much easier to just comment on this existing bug than to open
up a terminal and run 'ubuntu-bug cups' again, but that will help us a
great deal, even if we end up marking your new report as a duplicate of
this one.

Revision history for this message
Lucio M Nicolosi (lmnicolosi) wrote :

Clint,

In the new bug report, please consider that contrary to the stated at #30 (Martin Pitt) :
  "For lucid, ... samba reloads the printers every 750 seconds anyway, so it's just a matter of waiting..."
At least for some hardware configurations it doesn't happen for Maverick, Natty and Oneiric (as seen by the previous posts)

Also, please repost the working solution at #18 so that until a permanent solution is released, faulty systems can be easily patched.

Many thanks for addressing this issue again.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Right, so the 750 second reload bit may only work in some configurations. I'd like to get as much information about peoples' configurations to ascertain why this works for some, and not others.

If we move the start condition for samba to 'stopped rc', that will possibly break other peoples' configurations that may be depending on samba to start before rc.local, which happens just before 'stopped rc', so that is not a viable generic solution, though it does sound like a decent workaround for affected users.

Please, users who are affected, open new reports and link to them here. There is just way too much noise here for the issue to be clear. It may turn out that this wasn't fixed entirely, but it won't help to continue commenting here.

Revision history for this message
Chris Halse Rogers (raof) wrote :

Marking the Lucid task as New and removing the verification-needed tag; this has been superseded by a security update and needs uploading again, merged with the security update.

Changed in cups (Ubuntu Lucid):
status: Fix Committed → New
tags: removed: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

As nobody tested the lucid-proposed cups package in a year, let's just bury this.

Changed in cups (Ubuntu Lucid):
milestone: ubuntu-10.04.3 → none
status: New → Won't Fix
Revision history for this message
Jan Rathmann (kaiserclaudius) wrote :

This is again a problem on Precise. I have to delay the startup of Samba until CUPS is started, otherwise it won't find the shared printer.

Revision history for this message
Thilo Uttendorfer (t-lo) wrote :

I can confirm, this is still a problem on Precise. Please reopen this bug at least for precise. I could help with testing a fixed package.

Revision history for this message
Avi (avi-sayag) wrote :

Thank you very much

I have Ubuntu 12.04 LTE machine and had the same problem.

according to this post I manage to fix it

and this is what I done: ( in the file /etc/init/smbd.conf )

start on (local-filesystems and started cups and net-device-up)
stop on runlevel [!2345]

p.s.
1) The order of "started cups" and "net-device-up" is important!!!
2 )I just added "started cups" in the middle of the line.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.