Menu

Permission denied?

Help
F. Delente
2007-10-14
2013-05-09
  • F. Delente

    F. Delente - 2007-10-14

    Hello.

    I've set up LPRng-3.8.32 with apsfilter.

    I had much trouble compiling LPRng (trailing backslashes were not to make's taste); now that it is installed, I can't print because I don't have permission, even when I am root.

    My printer is USB, I can print files if I cat to /udev/lp0, but using this device in /etc/printcap doesn't work; I get this in /var/spool/lpd/lp:

    2007-10-14-16:23:32.113 swift [4876] (Worker - Print)  lp: setstatus: msg 'opening device '/udev/lp0''
    2007-10-14-16:23:32.113 swift [4876] (Worker - Print)  lp: Printer_open: device '/udev/lp0', max_attempts 3, grace 0, interval 10, max_interval 60
    2007-10-14-16:23:32.113 swift [4876] (Worker - Print)  lp: Printer_open: open '/udev/lp0' failed, max_attempts 3, attempt 0 'Permission denied'
    2007-10-14-16:23:32.113 swift [4876] (Worker - Print)  lp: setstatus: msg 'cannot open '/udev/lp0' - 'Permission denied', attempt 1, sleeping 10'
    2007-10-14-16:23:42.110 swift [4876] (Worker - Print)  lp: Printer_open: open '/udev/lp0' failed, max_attempts 3, attempt 1 'Permission denied'
    2007-10-14-16:23:42.110 swift [4876] (Worker - Print)  lp: setstatus: msg 'cannot open '/udev/lp0' - 'Permission denied', attempt 2, sleeping 20'
    2007-10-14-16:24:02.115 swift [4876] (Worker - Print)  lp: Printer_open: open '/udev/lp0' failed, max_attempts 3, attempt 2 'Permission denied'
    2007-10-14-16:24:02.115 swift [4876] (Worker - Print)  lp: setstatus: msg 'cannot open '/udev/lp0' - 'Permission denied', attempt 3, sleeping 40'

    Any help? Thanks.

     
    • grumpf_

      grumpf_ - 2007-10-15

      Hello Delente,
      please check the user/group permissions for /udev/lp0. lprng will access them with its own rights (lp/daemon something like that).

      please post if you have success

       
    • F. Delente

      F. Delente - 2007-10-20

      I changed permissions to root/lp for /dev/usb/lp0 (I can access the printer through this device too when I cat directly to it); however nothing changed, I still have the 'permission denied' message.

       
      • grumpf_

        grumpf_ - 2007-10-20

        that is strange. my lp0 looks like this:

        $ll /dev/lp0
        crw-rw----    1 root     lp         6,   0 2002-09-09 22:24 /dev/lp0

        while lpd is running as user lp
        $ps uU lp
        USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
        lp        6262  0.0  0.0  3268  220 ?        S<   Sep13   3:33 lpd Waiting

        does the same thing happen when you try the latest RC from sourceforge.net ?
        (just compile and replace the lpd should work) 

         
    • F. Delente

      F. Delente - 2007-10-24

      It was LPRng-3.8.32 that showed this behavior.

      I downloaded and installed 3.8.29-RC5 instead, now /dev/usb/lp0 has been set to

      crw-rw---- 1 daemon daemon 180, 0 2001-03-25 23:04 /dev/usb/lp0

      but I still can't print; apparently apsfilter has a problem with gs, since it can't find libX.so.6 (however gs works fine on the command line?)

       
    • F. Delente

      F. Delente - 2007-11-10

      Still no go, in /var/spool/lpd/lp I get errors that /usr/bin/gs can't read libXt.so.6:

      '/usr/bin/gs: error while loading shared libraries: libXt.so.6: cannot open shared object file: Permission denied'

      even though gs works ok the rest of the time.

      Help?

       
      • grumpf_

        grumpf_ - 2007-11-10

        that is very wired to say at least. It means that the execution environment is very different from that in the shell.
        Is it possible that your filter/backend works inside a chroot environment ? (perhaps the whoel lpd ?)

        re

         
      • steved

        steved - 2007-11-10

        su to the user that lprng is running as and then see if gs runs.
        Also what does "ldd /usr/bin/gs"  Give you?

         
    • F. Delente

      F. Delente - 2007-11-24

      Sorry for taking so long to respond.

      I tried to su to daemon (the user that owns lpd) and when I try to run gs under this account I get

      gs: error while loading shared libraries: libXt.so.6: cannot open shared object file: No such file or directory

      so this is definitely an environment problem; however daemon's home is /sbin, and it has no shell defined in /etc/passwd; how can I modify its environment so that I can modify LD_DIRECTORY_PATH?

      When I ldd /usr/bin/gs as daemon, it gives

      $ ldd /usr/bin/gs                                            
          libXt.so.6 => not found
          libSM.so.6 => not found
          libICE.so.6 => not found
          libXext.so.6 => not found
          libX11.so.6 => not found
          libdl.so.2 => /lib64/tls/libdl.so.2 (0x00002ac67ce0c000)
          libm.so.6 => /lib64/tls/libm.so.6 (0x00002ac67cf0f000)
          libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002ac67d096000)
          libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00002ac67d287000)
          libc.so.6 => /lib64/tls/libc.so.6 (0x00002ac67d3c5000)
          /lib64/ld-linux-x86-64.so.2 (0x00002ac67ccf4000)
          libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00002ac67d601000)
          libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00002ac67d70d000)
          libexpat.so.0 => /usr/lib64/libexpat.so.0 (0x00002ac67d897000)
          libz.so.1 => /usr/lib64/libz.so.1 (0x00002ac67d9ba000)

      I tried symlinking from /usr/lib64 to the X libs, but it doesn't seem to work...

       
    • F. Delente

      F. Delente - 2007-11-24

      Ok, I think I found it, it was an access problem on a directory... thanks for the help!

       

Log in to post a comment.