Operating System - HP-UX
1834391 Members
1926 Online
110066 Solutions
New Discussion

lp cant access files after reboot

 
Evelyn Daroga
Regular Advisor

lp cant access files after reboot

Can anyone explain this?
LP was able to print user files BEFORE the system was rebooted. AFTER the reboot, lp cannot access those files, with identical protections. The following script works fine on System A (was NOT rebooted), but not anymore on System B(WAS rebooted 2 days ago):

ll -d /fh_users
ll -d /fh_users/dbgonza
ll /fh_users/dbgonza/FILE.txt
lp -dDCA3300i_01 /fh_users/dbgonza/FILE.txt
echo
ll /fh_users/dbgonza/FILE.txt

Here is the output from the System A:
drwxrwxrwx 438 root visib 7168 Jul 27 09:53 /fh_users
drwxrwxrwx 4 dbgonza visib 1024 Jul 29 10:59 /fh_users/dbgonza
-rw-rw---- 1 dbgonza visib 7038 Jul 29 09:32 /fh_users/dbgonza/FILE.txt
request id is DCA3300i_01-468 (1 file)
-rw-rw---- 1 dbgonza visib 7038 Jul 29 09:32 /fh_users/dbgonza/FILE.txt


Here is the output from System B:
drwxrwxrwx 341 root visib 8192 Jul 27 09:48 /fh_users
drwxrwxrwx 4 dbgonza visib 10240 Jul 29 10:59 /fh_users/dbgonza
-rw-rw---- 1 dbgonza visib 7038 Jul 29 07:15 /fh_users/dbgonza/FILE.txt
lp: can't access file "/fh_users/dbgonza/FILE.txt"
lp: request not accepted
-rw-rw---- 1 dbgonza visib 7038 Jul 29 07:15 /fh_users/dbgonza/FILE.txt

We need this to work on System A, as it did 3 days ago before rebooting.

Ideas anyone ??

4 REPLIES 4
Chris Wilshaw
Honored Contributor

Re: lp cant access files after reboot

What are the permissions on /usr/bin/lp?

They should be -r-sr-xr-x with the file owned by root, with a group of bin.

If this doesn't have the setuid bit enabled, it won't run as root, which could be the cause of your problem.
generic_1
Respected Contributor

Re: lp cant access files after reboot

You sure your printer que just did not restart after the reboot?
Alessandro Pilati
Esteemed Contributor

Re: lp cant access files after reboot

- Check if the scheduler is running ( lpstat -t )
- chmod 4555 /usr/bin/lp ( as said by Chris )

Rgds,
Alex
if you don't try, you'll never know if you are able to
Evelyn Daroga
Regular Advisor

Re: lp cant access files after reboot

Thanks for the quick replies, but all looks ok so far:

-r-sr-xr-x 1 root bin 49152 Sep 21 2000 /usr/bin/lp

lpstat -t
scheduler is running

ps -ef | grep lpsched
lp 1486 1 0 Jul 27 ? 0:11 /usr/sbin/lpsched
lp 21242 1486 0 12:00:23 ? 0:00 /usr/sbin/lpsched

Note: Jul 27 is when the Sys B was rebooted. Other things are printing. This appears to be a priv problem on the FILE.txt, as if I chomd 666 FILE.txt, it can print. So, I can explain clearly why it won't print now -- the protections on the file prevent access to lp:lp. What I can't explain is why it worked up till the reboot, and why it still works on Sys A ??
I can cron a job to chmod these files if I have to, but this process has worked for a long time without having to do that.

Any more ideas ??