Canon printing system software problem

Booting, installing, newbie
Post Reply
Message
Author
mikprog
Posts: 21
Joined: Mon 30 Mar 2020, 14:11

Canon printing system software problem

#1 Post by mikprog »

I need help regarding to start up ccpd daemon of Canon CAPT printer driver at boot time.

I use official Canon LBP 810 linux drivers installed on my BionicPup32. Installation procedure creates Canon printing system ccpd control script in init.d like

Code: Select all

#!/bin/sh
# startup script for Canon Printer Daemon for CUPS (ccpd)

if [ `ps awx | grep cupsd | grep -v grep | wc -l` -eq 0 ]; then
	while [ `ps awx | grep cupsd | grep -v grep | wc -l` -eq 0 ]
	do
		sleep 3
	done
	sleep 5
fi

if [ -f /etc/rc.d/init.d/functions ]; then
	if [ -f /etc/slackware-version ]; then
		SYS_F="SL"
	else
		. /etc/rc.d/init.d/functions 
		SYS_F="RH"
	fi
elif [ -x /sbin/startproc ]; then
	SYS_F="Su"
elif [ -x /sbin/start-stop-daemon ]; then
	SYS_F="De"
fi

etc.......
 

All of the puppy services initiated from init.d directory are started by simle /etc/rc.d/rc.services script

Code: Select all

for service_script in /etc/init.d/*
do
 [ -x $service_script ] && $service_script start
done
This code launches every of init.d scripts one by one and waits until current script finish it's work before continue with next script. Reason of my problem is rc.services processes init.d scripts in alphabetic order

Code: Select all

-rwxr-xr-x 1 root root  108 Mar 23  2019 00sys_logger
-rwxr-xr-x 1 root root 5435 Mar 23  2019 10alsa
-rw-r--r-- 1 root root  524 Mar 13  2019 crond
-rwxr-xr-x 1 root root 1547 Apr 27 15:44 ccpd
-rwxr-xr-x 1 root root  906 Sep 15  2019 cups
-rwxr-xr-x 1 root root 2806 Jun 14  2019 dbus
So ccpd script started before cups and waits until infinity when cups will be started. (See above "while [ `ps awx | grep cupsd | grep -v grep | wc -l` -eq 0 ] do sleep 3"). But cups never been started until ccpd finished. Dead loop. All other init.d system services after ccpd are not started too. System becomes like zombie puppy.

I can rename ccpd, for example, into zccpd to change script processing order. It works. But I feel it is not right way to solve problem. What right 'linux way' solution be?

ozsouth
Posts: 858
Joined: Fri 01 Jan 2010, 22:08
Location: S.E Australia

#2 Post by ozsouth »

@mikprog - I sometimes do similar quick & dirty hacks. Whilst not ideal, sometimes it's for the best. Several shell scripts in Puppy have sleeps & naming for timing issues, as we see in /etc/init.d.

Post Reply