Bug 710325

Summary: Canon CAPT Printer Daemon ccpd does not start correctly
Product: [Fedora] Fedora Reporter: Anil Seth <seth.anil>
Component: systemdAssignee: Lennart Poettering <lpoetter>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 15CC: harald, johannbg, lpoetter, metherid, mschmidt, notting, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-03 14:18:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Anil Seth 2011-06-03 04:46:40 UTC
Description of problem:
The ccpd daemon does not start correctly and printing fails on a Canon LBP2900. 
/etc/init.d/ccpd status shows one process running.
When it is running normally, it should show 2 processes running.
No errors are reported.
We need to stop the ccdp server and restart it.

Version-Release number of selected component (if applicable):
systemd-26-2.fc15.x86_64
CAPT Printer Driver for Linux Version 2.30

How reproducible:
Every boot.

Steps to Reproduce:
1.Install driver from http://support-asia.canon-asia.com/contents/ASIA/EN/0900772407.html
2.add /etc/init.d/ccdp start to /etc/rc.local
3.
  
Actual results:
bash-4.2$ sudo systemctl status ccpd.service
ccpd.service - LSB: Start Canon Printer Daemon for CUPS
	  Loaded: loaded (/etc/rc.d/init.d/ccpd)
	  Active: active (running) since Fri, 03 Jun 2011 09:49:25 +0530; 1min 47s ago
	 Process: 2603 ExecStart=/etc/rc.d/init.d/ccpd start (code=exited, status=0/SUCCESS)
	Main PID: 2634 (ccpd)
	  CGroup: name=systemd:/system/ccpd.service
		  └ 2634 /usr/sbin/ccpd

Expected results:
bash-4.2$ sudo systemctl status ccpd.service
ccpd.service - LSB: Start Canon Printer Daemon for CUPS
	  Loaded: loaded (/etc/rc.d/init.d/ccpd)
	  Active: active (running) since Fri, 03 Jun 2011 09:56:52 +0530; 11min ago
	 Process: 5681 ExecStop=/etc/rc.d/init.d/ccpd stop (code=exited, status=0/SUCCESS)
	 Process: 5693 ExecStart=/etc/rc.d/init.d/ccpd start (code=exited, status=0/SUCCESS)
	Main PID: 5698 (ccpd)
	  CGroup: name=systemd:/system/ccpd.service
		  ├ 5698 /usr/sbin/ccpd
		  ├ 5702 /usr/sbin/ccpd
		  └ 5703 captmon2 --data-write-fd=8 --data-read-fd=12 --cmd...


Additional info:

Comment 1 Michal Schmidt 2011-06-03 13:18:57 UTC
(In reply to comment #0)
> 2.add /etc/init.d/ccdp start to /etc/rc.local

Ugh. Can you instead enable ccdp using chkconfig like you would for any other initscript?

Comment 2 Anil Seth 2011-06-03 13:42:04 UTC
"systemctl enable ccpd.service" reported that the file was incompatible with chkconfig. But I found a link with the lines to add to make it compatible with chkconfig. The file was for OpenSuse and had the line
# Should-Start: $ALL

It created links S-1ccpd. So, I just deleted the $all option. It then created the link S50ccpd. The lines added were:

### BEGIN INIT INFO
# Provides:          ccpd
# Required-Start:    $local_fs $remote_fs $syslog $network $named
# Should-Start:
# Required-Stop:     $syslog $remote_fs
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Description:       Start Canon Printer Daemon for CUPS
### END INIT INFO`

Still, the problem was the same. I then used rc.local as that is the last thing done. 

I was also confused by cups insisting on adding an additional printer LBP2900-2 for device usb://Canon/LBP2900. But that seems to be harmless.

Incidentally, the Canon's printer support of Linux is definitely very-very flaky. It does not seem to handle or report any errors properly. Should not have bought it.

Comment 3 Michal Schmidt 2011-06-03 14:18:43 UTC
I see. The main problem with that initscript is that it's missing a chkconfig line, for instance:
# chkconfig: - 90 10

If you add it, "chkconfig --add ccpd" will work and "chkconfig ccpd on" will too.


The problem with starting units from other units (rc-local.service is a kind of a unit too) is that it may lead to deadlocks such as the one described in:
https://bugzilla.redhat.com/show_bug.cgi?id=690177#c10
(The "--ignore-dependencies" trick should work in your case too. But I really recommend to make ccpd work as a proper initscript instead.)