rpe 9a8b5ccd06 Change the shebang line from /bin/sh to /bin/ksh in all ports rc.d
daemon scripts and bump subpackages that contain the *.rc scripts.

discussed with and OK aja@
OK tb
2018-01-11 19:27:01 +00:00

39 lines
1.0 KiB
Bash
Executable File

#!/bin/ksh
#
# $OpenBSD: cupsd.rc,v 1.27 2018/01/11 19:27:08 rpe Exp $
daemon="${TRUEPREFIX}/sbin/cupsd"
. /etc/rc.d/rc.subr
pexp="${daemon} .*"
rc_pre() {
# XXX remove for OPENBSD_6_3
rm -f /usr/bin/lp{q,r,rm}.pre-cups /usr/sbin/lp{c,d}.pre-cups \
/usr/share/man/man1/lp{q,r,rm}.1 /usr/share/man/man8/lp{c,d}.8
# XXX cups-driverd(8) can crash when setting up a printer driver
rm -f /var/cache/cups/*
# rcexec is needed if openfiles limits are bumped and cupsd(8) runs in
# debug mode to prevent MaxClients warnings in logs
${rcexec} "${daemon} ${daemon_flags} -t" || return 1
# no existing printcap means we're not running lpd(8) so link cups'
# printcap so base lp commands can find and use cups printers
if [ ! -e /etc/printcap ]; then
ln -s ${SYSCONFDIR}/cups/printcap /etc/printcap
# please check_mtree() in security(8); /etc/mtree/special
chmod -h 0644 /etc/printcap
fi
}
rc_post() {
if [ -h /etc/printcap ]; then
rm /etc/printcap
fi
}
rc_cmd $1