HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: //etc/init/cupsd.conf
description "cups daemon"
author "System Integration Team"
console log

start on syno.share.ready and syno.network.ready
expect fork

respawn
respawn limit 5 10

pre-start script
	if ! /usr/syno/etc/rc.sysv/cupsd.sh prestart ; then
		stop; exit 0
	fi
end script

exec /usr/bin/cupsd -c /etc/cups/cupsd.conf

post-start script
	GCP_NUM=`/usr/syno/bin/synoprint --list | xargs -n 1 /usr/syno/bin/synoprint --ckgcp $1 | grep on | wc -l` || true
	AP_NUM=`/usr/syno/bin/synoprint --list | xargs -n 1 /usr/syno/bin/synoprint --ckairprint $1 | grep on | wc -l` || true

	if [ ${GCP_NUM} -eq 1 -o ${AP_NUM} -eq 1 ]; then
		/usr/syno/bin/synoprint --upgrade all &
	fi

	/usr/syno/etc/rc.sysv/cupsd.sh poststart || true

	# when start cups need to reload smbd. see Bugs [DSM] #64901
	/usr/syno/sbin/synoservice --reload samba || true
end script