Bug 56029 - Make univention-printserver python3 compatible
Summary: Make univention-printserver python3 compatible
Status: CLOSED WORKSFORME
Alias: None
Product: UCS
Classification: Unclassified
Component: Printserver
Version: UCS 5.0
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: UCS maintainers
QA Contact: UCS maintainers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-02 16:59 CEST by Christina Scheinig
Modified: 2023-05-03 16:23 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023050221000342
Bug group (optional):
Customer ID: 07312
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2023-05-02 16:59:37 CEST
The package "univention-printserver" brings a template "/etc/univention/templates/files/etc/cups/cupsd.conf.d/01cupsd-base" which is not Python3 compatible. Therefore the upgrade fails.
------------------
The system can not be updated to UCS 5.0 due to the following reasons:
 
python_ucr_template_compatibility:
The following UCR templates are not compatible with Python 3:
         /etc/univention/templates/files/etc/cups/cupsd.conf.d/01cupsd-base (package: univention-printserver)
See <https://help.univention.com/t/17948> for information on how to proceed with each template.
         /etc/univention/templates/files/etc/samba/base.conf (package: univention-samba)
See <https://help.univention.com/t/17948> for information on how to proceed with each template.
---------------------


These adjustments had to be made in two files, otherwise CUPS does not print properly:
------------------------ 
/etc/univention/templates/files/etc/cups/cupsd.conf.d/01cups-base
PreserveJobFiles Yes
MaxJobs 0
 
 
/etc/univention/templates/files/etc/samba/base.conf
[printers]
        comment = Drucker
        browseable = no
        path = /tmp
        printable = yes
        public = no
        writable = no
        create mode = 0700
        # use client driver = true
        # lpq command = lpstat -o %p
        # lprm command = cancel %p-%j
        # using windows printer drivers
        # print command = lpr -P %p -o raw %s -r
        print command = /opt/papercut/providers/print/linux-x64/samba-print-provider -u "%u" -J "%J" -h "%h" -m "%m" -p "%p" -s "%s" -a "lp -c -d%p %s; rm %s" &
        #print command = /opt/papercut/providers/print/linux-x64/samba-print-provider -u "%u" -J "%J" -h "%h" -m "%m" -p "%p" -s "%s" -a "lpr -r -o raw -P%p %s" &
        # using cups drivers (PostScript on Windows)
        # print command = lpr -P %p %s
--------------------

There are no UCR variables for all the changes, so these changes had to be made  manually. Could UCR variables be created for this?
Comment 1 Florian Best univentionstaff 2023-05-02 18:06:45 CEST
/etc/univention/templates/files/etc/cups/cupsd.conf.d/01cupsd-base was migrated by Bug #52814 git:ef2b987b3ecea1d48577966fb7070c42b02ac704 years ago (UCS 4.4-7).
Did you check "univention-check-templates" if it's really the original version and not overwritten?
Comment 2 Stephan Hendl 2023-05-03 07:59:49 CEST
Well, the 01cupsd-base file was migrated but since we've had to insert changes into it (as Christina oulined) the update process in 4.4-7 put a separate dpkg-dist file on the disk. 

We adopted the changes and the upgrade to 5.0-3 worked as expected after that.

I would appreceate three additional UCR variables for the changes in 01cupsd-base as well as samba/base.conf that we don't have to change the templates again.
Comment 3 Arvid Requate univentionstaff 2023-05-03 09:01:46 CEST
Ok, trying to re-structure this bug to make it tractable:

For the adjustment to cupsd.conf I found the option of Bug #19552:
==========================================
root@ucs# cat >> /etc/cups/cupsd.local.conf  <<%EOF

PreserveJobFiles Yes
MaxJobs 0
%EOF
root@ucs# ucr set cups/include/local=yes
root@ucs# /etc/init.d/cups restart
==========================================

Does that cover the requested configurability for cupsd.conf ?
Comment 4 Arvid Requate univentionstaff 2023-05-03 09:19:36 CEST
For the second part of adjusting the "print command" in /etc/samba/base.conf
the UCR template for smb.conf gives us this option to extend/adjust/override
settings in arbitrary configuration sections:

==========================================
cat >> /etc/samba/local.conf <<%EOF

[printers]
    print command = /opt/papercut/providers/print/linux-x64/samba-print-provider -u "%u" -J "%J" -h "%h" -m "%m" -p "%p" -s "%s" -a "lp -c -d%p %s; rm %s" &

%EOF

ucr commit /etc/samba/smb.conf
testparm -sv | less              ## check
# /etc/init.d/samba restart      ## uncomment if changes should become active
==========================================
Comment 5 Christina Scheinig univentionstaff 2023-05-03 16:18:52 CEST
The customer now used the local.conf and it worked fine. There is no need for ucr variables.