* bug#33105: cups Can't create temporary file or stopped "Filter failed"
@ 2018-10-20 18:36 Oleg Pykhalov
2018-10-21 6:53 ` Efraim Flashner
2018-10-24 12:52 ` Ludovic Courtès
0 siblings, 2 replies; 3+ messages in thread
From: Oleg Pykhalov @ 2018-10-20 18:36 UTC (permalink / raw)
To: 33105
[-- Attachment #1: Type: text/plain, Size: 1843 bytes --]
Hello Guix,
I've spotted a bug in CUPS service “Can't create temporary file”. If I
gave ‘765’ permissions to ‘/var/spool/cups/tmp/’ directory then an error
is “stopped "Filter failed"”. ‘777’ for /var/spool/cups/tmp/ is
required to print a test page via CUPS WEB interface.
I read gnu/services/cups.scm and found that the /var/spool/cups/
directory should be owned by ‘lp’ user:
--8<---------------cut here---------------start------------->8---
(define %cups-activation
;; Activation gexp.
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils))
(define (mkdir-p/perms directory owner perms)
(mkdir-p directory)
(chown "/var/run/cups" (passwd:uid owner) (passwd:gid owner))
;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(chmod directory perms))
;; …
(let ((user (getpwnam "lp")))
;; …
(mkdir-p/perms "/var/spool/cups/tmp" user #o755) ; <----------
;; …
))))
--8<---------------cut here---------------end--------------->8---
Maybe we should make /var/spool/cups/tmp directory owned by ‘lp’ user,
too? WDYT?
Test page was printed successfully with:
--8<---------------cut here---------------start------------->8---
$ sudo ls -ld /var/spool/cups/tmp
drwxr-xr-x 2 lp lp 4096 Oct 20 21:20 /var/spool/cups/tmp
--8<---------------cut here---------------end--------------->8---
From cups-files.conf(5) man page:
TempDir directory
Specifies the directory where short-term temporary files are
stored. The default is "/var/spool/cups/tmp".
User username
Specifies the user name or ID that is used when running external
programs. The default is "lp".
Oleg.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#33105: cups Can't create temporary file or stopped "Filter failed"
2018-10-20 18:36 bug#33105: cups Can't create temporary file or stopped "Filter failed" Oleg Pykhalov
@ 2018-10-21 6:53 ` Efraim Flashner
2018-10-24 12:52 ` Ludovic Courtès
1 sibling, 0 replies; 3+ messages in thread
From: Efraim Flashner @ 2018-10-21 6:53 UTC (permalink / raw)
To: Oleg Pykhalov; +Cc: 33105
[-- Attachment #1: Type: text/plain, Size: 2372 bytes --]
On Sat, Oct 20, 2018 at 09:36:57PM +0300, Oleg Pykhalov wrote:
> Hello Guix,
>
> I've spotted a bug in CUPS service “Can't create temporary file”. If I
> gave ‘765’ permissions to ‘/var/spool/cups/tmp/’ directory then an error
> is “stopped "Filter failed"”. ‘777’ for /var/spool/cups/tmp/ is
> required to print a test page via CUPS WEB interface.
>
>
> I read gnu/services/cups.scm and found that the /var/spool/cups/
> directory should be owned by ‘lp’ user:
> --8<---------------cut here---------------start------------->8---
> (define %cups-activation
> ;; Activation gexp.
> (with-imported-modules '((guix build utils))
> #~(begin
> (use-modules (guix build utils))
> (define (mkdir-p/perms directory owner perms)
> (mkdir-p directory)
> (chown "/var/run/cups" (passwd:uid owner) (passwd:gid owner))
> ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> (chmod directory perms))
> ;; …
> (let ((user (getpwnam "lp")))
> ;; …
> (mkdir-p/perms "/var/spool/cups/tmp" user #o755) ; <----------
> ;; …
> ))))
> --8<---------------cut here---------------end--------------->8---
>
>
> Maybe we should make /var/spool/cups/tmp directory owned by ‘lp’ user,
> too? WDYT?
currently /var/spool/cups is root:lp, my first thought is to change it
to lp:lpadmin (not sure where I got lpadmin from) and make it 775.
>
> Test page was printed successfully with:
> --8<---------------cut here---------------start------------->8---
> $ sudo ls -ld /var/spool/cups/tmp
> drwxr-xr-x 2 lp lp 4096 Oct 20 21:20 /var/spool/cups/tmp
> --8<---------------cut here---------------end--------------->8---
>
>
> From cups-files.conf(5) man page:
>
> TempDir directory
> Specifies the directory where short-term temporary files are
> stored. The default is "/var/spool/cups/tmp".
>
> User username
> Specifies the user name or ID that is used when running external
> programs. The default is "lp".
>
>
> Oleg.
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#33105: cups Can't create temporary file or stopped "Filter failed"
2018-10-20 18:36 bug#33105: cups Can't create temporary file or stopped "Filter failed" Oleg Pykhalov
2018-10-21 6:53 ` Efraim Flashner
@ 2018-10-24 12:52 ` Ludovic Courtès
1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2018-10-24 12:52 UTC (permalink / raw)
To: Oleg Pykhalov; +Cc: 33105
Hi Oleg,
Oleg Pykhalov <go.wigust@gmail.com> skribis:
> I read gnu/services/cups.scm and found that the /var/spool/cups/
> directory should be owned by ‘lp’ user:
>
> (define %cups-activation
> ;; Activation gexp.
> (with-imported-modules '((guix build utils))
> #~(begin
> (use-modules (guix build utils))
> (define (mkdir-p/perms directory owner perms)
> (mkdir-p directory)
> (chown "/var/run/cups" (passwd:uid owner) (passwd:gid owner))
> ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> (chmod directory perms))
> ;; …
> (let ((user (getpwnam "lp")))
> ;; …
> (mkdir-p/perms "/var/spool/cups/tmp" user #o755) ; <----------
> ;; …
> ))))
>
>
>
> Maybe we should make /var/spool/cups/tmp directory owned by ‘lp’ user,
> too? WDYT?
>
> Test page was printed successfully with:
>
> $ sudo ls -ld /var/spool/cups/tmp
> drwxr-xr-x 2 lp lp 4096 Oct 20 21:20 /var/spool/cups/tmp
I don’t know the answer :-), but from what you’re saying, it looks like
making /var/spool/cups/tmp ‘lp’-owned is the right thing.
If it works for you, I guess you can go ahead!
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-24 12:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-20 18:36 bug#33105: cups Can't create temporary file or stopped "Filter failed" Oleg Pykhalov
2018-10-21 6:53 ` Efraim Flashner
2018-10-24 12:52 ` Ludovic Courtès
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).