Hi all.
Error from journalctl -u cups:
set 21 18:34:55 kubuntu /usr/lib/cups/backend/cups-x2go[412569]: Print job received from cups -> 1060 rui Re: [X2Go-User] Client Printing not working! 1 Collate media=iso_a4_210x297mm_borderless Duplex=None job-uuid=urn:uuid:1bce9974-59ca-3cad-7012-b36b56aaf124 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1695317694 time-at-processing=1695317694 PageSize=A4
set 21 18:34:56 kubuntu /usr/lib/cups/backend/cups-x2go[412569]: ERROR: ps2pdf conversion program failed to convert /tmp/1060-rui-cupsjob412569RZtB07cJEZ6R_uD_: failed with exit code 1
set 21 18:34:56 kubuntu /usr/lib/cups/backend/cups-x2go[412569]: ERROR: cups-x2go failed to process postscript file /tmp/1060-rui-cupsjob412569RZtB07cJEZ6R_uD_
Output from cat /etc/systemd/system/printer.target.wants/cups.service:
[Unit] Description=CUPS Scheduler Documentation=man:cupsd(8) After=network.target nss-user-lookup.target nslcd.service Requires=cups.socket
[Service] ExecStart=/usr/sbin/cupsd -l Type=notify Restart=on-failure PrivateTmp=false <----------------------------------------
[Install] Also=cups.socket cups.path WantedBy=printer.target multi-user.target
(even though this is not the right way to make local changes to systemd)
I've issued the commands systemctl daemon-reload and systemctl restart cups.service
OS: kubuntu 22.04 x2goserver 4.1.0.3 cups 2.4.1
Regards, Rui Ferreira
HI Rui,
thanks for reporting the below issue.
On Do 21 Sep 2023 20:28:44 CEST, Rui Ferreira wrote:
Hi all.
Error from journalctl -u cups:
set 21 18:34:55 kubuntu /usr/lib/cups/backend/cups-x2go[412569]:
Print job received from cups -> 1060 rui Re: [X2Go-User] Client
Printing not working! 1 Collate media=iso_a4_210x297mm_borderless
Duplex=None job-uuid=urn:uuid:1bce9974-59ca-3cad-7012-b36b56aaf124
job-originating-host-name=localhost date-time-at-creation=
date-time-at-processing= time-at-creation=1695317694
time-at-processing=1695317694 PageSize=A4set 21 18:34:56 kubuntu /usr/lib/cups/backend/cups-x2go[412569]:
ERROR: ps2pdf conversion program failed to convert
/tmp/1060-rui-cupsjob412569RZtB07cJEZ6R_uD_: failed with exit code 1set 21 18:34:56 kubuntu /usr/lib/cups/backend/cups-x2go[412569]:
ERROR: cups-x2go failed to process postscript file
/tmp/1060-rui-cupsjob412569RZtB07cJEZ6R_uD_Output from cat /etc/systemd/system/printer.target.wants/cups.service:
[Unit] Description=CUPS Scheduler Documentation=man:cupsd(8) After=network.target nss-user-lookup.target nslcd.service Requires=cups.socket
[Service] ExecStart=/usr/sbin/cupsd -l Type=notify Restart=on-failure PrivateTmp=false <----------------------------------------
[Install] Also=cups.socket cups.path WantedBy=printer.target multi-user.target
(even though this is not the right way to make local changes to systemd)
I've issued the commands systemctl daemon-reload and systemctl restart cups.service
OS: kubuntu 22.04 x2goserver 4.1.0.3 cups 2.4.1
As X2Go developers, we don't have much impact on the CUPS systemd
service start file. That is owned by the CUPS software package.
However, we can tweak cups-x2go [1]. It would be nice if you could
experiment with that a little and move the "$ENV{TMPDIR}="/tmp";"
statement that is part of the script to the very top of the script
(after all the "use ...;" statements.
When done, remove your hack again (which brings back more security
into your CUPS daemon) and re-test cups-x2go. Let me know if that
works for you. If so, please send your patch.
DAS-NETZWERKTEAM c\o Technik- und Ökologiezentrum Eckernförde Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde mobile: +49 (1520) 1976 148 landline: +49 (4351) 850 8940
GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22 0782 9AF4 6B30 2577 1B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
Às 19:37 de 21/09/23, Mike Gabriel escreveu:
HI Rui,
thanks for reporting the below issue.
[...]>
However, we can tweak cups-x2go [1]. It would be nice if you could experiment with that a little and move the "$ENV{TMPDIR}="/tmp";" statement that is part of the script to the very top of the script (after all the "use ...;" statements.
When done, remove your hack again (which brings back more security into your CUPS daemon) and re-test cups-x2go. Let me know if that works for you. If so, please send your patch.
Thanks, Mike
Hello Mike
Thank you for your fast response and sorry for my slow one.
It wasn't that, but your tip showed me the way. The answer begins here:
https://git.ghostscript.com/?p=ghostpdl.git&a=search&h=HEAD&st=commit&s=setpdfwrite
Ghostscript deprecated 'setpdfwrite' in 2019 and removed it in 2021, or version 9.54. To solve this, I edited /etc/cups/cups-x2go.conf:
ps2pdf = /usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=- -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -dDoNumCopies -f \"%s\"
This alone should've solved my problem... yet it wasn't working :( After many hours of self commiseration, I found that the culprit to be a leading space in the command, in this line
my $gs_pid = open2 ($gs_out, $gs_in, $ps2pdf_cmd, @ps2pdf_args);
where $ps2pdf_cmd would translate to ' /usr/bin/gs'.
So, I had to learn just enough Perl to correct this:
if($option eq "ps2pdf") { $ps2pdf=$value; $ps2pdf=~s/^\s+//; <-------- my solution }
Now, about sending patches... I've never done it before.
I'm not sure if just changing the default ghostscript command line, hardcoded in the Perl script and the .conf file, is the best solution for everyone. And I'm not sure if the way I found to trim that leading whitespace is the best solution.
I'm too uncertain.
Regards, Rui Ferreira
Hi Rui,
On Sa 23 Sep 2023 02:01:23 CEST, Rui Ferreira wrote:
Às 19:37 de 21/09/23, Mike Gabriel escreveu:
HI Rui,
thanks for reporting the below issue.
[...]>
However, we can tweak cups-x2go [1]. It would be nice if you could
experiment with that a little and move the "$ENV{TMPDIR}="/tmp";"
statement that is part of the script to the very top of the script
(after all the "use ...;" statements.When done, remove your hack again (which brings back more security
into your CUPS daemon) and re-test cups-x2go. Let me know if that
works for you. If so, please send your patch.Thanks, Mike
Hello Mike
Thank you for your fast response and sorry for my slow one.
It wasn't that, but your tip showed me the way. The answer begins here:
https://git.ghostscript.com/?p=ghostpdl.git&a=search&h=HEAD&st=commit&s=setpdfwrite
Ghostscript deprecated 'setpdfwrite' in 2019 and removed it in 2021,
or version 9.54. To solve this, I edited /etc/cups/cups-x2go.conf:ps2pdf = /usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH
-dSAFER -sDEVICE=pdfwrite -sOutputFile=-
-dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false
-dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress
-dDoNumCopies -f \"%s\"This alone should've solved my problem... yet it wasn't working :( After many hours of self commiseration, I found that the culprit to
be a leading space in the command, in this linemy $gs_pid = open2 ($gs_out, $gs_in, $ps2pdf_cmd, @ps2pdf_args);
where $ps2pdf_cmd would translate to ' /usr/bin/gs'.
So, I had to learn just enough Perl to correct this:
if($option eq "ps2pdf") { $ps2pdf=$value; $ps2pdf=~s/^\s+//; <-------- my solution }
Now, about sending patches... I've never done it before.
I'm not sure if just changing the default ghostscript command line,
hardcoded in the Perl script and the .conf file, is the best
solution for everyone. And I'm not sure if the way I found to trim that leading whitespace
is the best solution.I'm too uncertain.
Regards, Rui Ferreira
Thanks for the follow-up. To be 100% sure, your changes land in
cups-x2go appropriately, please do the following:
<install package git> git clone https://code.x2go.org/git/cups-x2go.git
Now copy your version of the cups-x2go script into the newly cloned
cups-x2go/ folder.
Change dir into that folder and check output of "git diff".
Commit that change, e.g. via "git commit --patch -m "cups-x2go: Fix
<this and that>." Find a good commit message one-liner.
The run "git format-patch HEAD~..HEAD". This will create a patch file.
Please send this patch file attached to a reply to this mail.
Thanks!
Mike
--
DAS-NETZWERKTEAM c\o Technik- und Ökologiezentrum Eckernförde Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde mobile: +49 (1520) 1976 148 landline: +49 (4351) 850 8940
GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22 0782 9AF4 6B30 2577 1B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
Hello again Mike.
Às 20:03 de 23/09/23, Mike Gabriel escreveu:
Hi Rui,
[...]
Thanks for the follow-up. To be 100% sure, your changes land in cups-x2go appropriately, please do the following:
<install package git> git clone https://code.x2go.org/git/cups-x2go.git
Now copy your version of the cups-x2go script into the newly cloned cups-x2go/ folder.
Change dir into that folder and check output of "git diff".
Commit that change, e.g. via "git commit --patch -m "cups-x2go: Fix <this and that>." Find a good commit message one-liner.
The run "git format-patch HEAD~..HEAD". This will create a patch file.
Please send this patch file attached to a reply to this mail.
I divided the changes into 2 patches. Hope I did it right.
One concerns the change in Ghostscript. The other one is the correction to the parsing of the conf file.
Regards, Rui Ferreira