PREUN
/bin/sh
# Let CUPS daemon not be automatically started at boot time any more
/usr/share/rpm-helper/del-service cups $1 cups
#_preun_service cups-lpd
POSTIN
/bin/sh
/usr/bin/systemd-tmpfiles --create cups.conf
/usr/bin/systemd-tmpfiles --create cups-lp.conf
# We can't enforce this. Bug #35993
for d in /opt/share/ppd /opt/lib/printdriver /usr/local/share/ppd /usr/local/lib/printdriver
do
[ ! -e $d ] && mkdir -p $d || :
done
# End of 28383
# Previous migration script unnecessarily put PageLogFormat into cups-files.conf
# (see bug #1148995)
FILE=/etc/cups/cups-files.conf
for keyword in PageLogFormat; do
/bin/sed -i -e "s,^$keyword,#$keyword,i" "$FILE" || :
done
# Because of moving logs to journal, we need to create placeholder files
# at /var/log/cups for users, whose are going to install CUPS on new OS
# machine with info message
confignames=( "ErrorLog" "AccessLog" "PageLog" )
lognames=( "error_log" "access_log" "page_log" )
message="This CUPS log has been moved into journal by default unless changes have been made in /etc/cups/cups-files.conf. Log messages can be got by \"$ journalctl -u cups -e\""
for ((i=0;i<${#confignames[@]};i++));
do
found=`/usr/bin/grep -i "${confignames[i]} syslog" /etc/cups/cups-files.conf`
if [ ! -z "$found" ]
then
if [ ! -f /var/log/cups/${lognames[i]} ]
then
/usr/bin/touch /var/log/cups/${lognames[i]} || :
fi
perms=`/usr/bin/ls -lah /var/log/cups/${lognames[i]} | /usr/bin/grep -v -e "\-rw-------" -e "root lp"`
if [ ! -z "$perms" ]
then
# we need to set correct permissions and ownership because of possible
# security issues
# we need to have it here, because previous CUPS releases had the bug.
# Checking permissions and ownership here fixes it.
/usr/bin/chown root:lp /var/log/cups/${lognames[i]} || :
/usr/bin/chmod 600 /var/log/cups/${lognames[i]} || :
fi
lastmessage=`/usr/bin/tail -n 1 /var/log/cups/${lognames[i]} | /usr/bin/grep "$message"`
if [ -z "$lastmessage" ]
then
/usr/bin/echo $message >> /var/log/cups/${lognames[i]} || :
fi
fi
done
# Let CUPS daemon be automatically started at boot time
/usr/share/rpm-helper/add-service cups $1 cups
#_post_service cups-lpd
POSTUN
/bin/sh
/usr/share/rpm-helper/del-group cups $1 lpadmin
#_postun_service cups-lpd