Operating System - HP-UX
1752749 Members
4880 Online
108789 Solutions
New Discussion юеВ

Re: It possible for the spool file owner to read and modify in the spool file using vi ?

 
SOLVED
Go to solution
Roxana_4
Frequent Advisor

It possible for the spool file owner to read and modify in the spool file using vi ?

My names is Roxana. I work on a HP-UX 11.23 system.
The user sends a file to the printer using lp command. The spooler that has been created is not listed and can be consulted by the admin in /var/spool/lp/request/hp8150. How is it possible for the file owner to read and modify in the spool file using vi ?

Thank you
an best regards
12 REPLIES 12
Arunvijai_4
Honored Contributor

Re: It possible for the spool file owner to read and modify in the spool file using vi ?

Hello,

Just check the permission before editing,

ll /var/spool/lp/request/hp8150

should help you,

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Roxana_4
Frequent Advisor

Re: It possible for the spool file owner to read and modify in the spool file using vi ?

The user sends a file to the printer using lp command. The spooler that has been created is not listed and can be consulted by the admin in /var/spool/lp/request/hp8150. How is it possible for the file owner to read and modify in the spool file using vi ?
When the user is trying to control the spool file with vi, the message is " permission denied ". Only the administrator can control the spool file with vi.
What can i do if i want user (not administrator) to control with vi the spool file created by itself.
Arunvijai_4
Honored Contributor

Re: It possible for the spool file owner to read and modify in the spool file using vi ?

Hi Roxana,

Can you check, # ll /var/spool/lp/request/hp8150

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Senthil Kumar .A_1
Honored Contributor
Solution

Re: It possible for the spool file owner to read and modify in the spool file using vi ?

Hi Roxana,

As of ur query, I understand that you want the user to modify the spool file in the request directory. That means, user should be able to modify it before it gets printed.

In a printer spooler system,when a user submits a job with the command "lp", the print job gets queued. From now on, the system admin user takes care of the queue, and normal user would not have a direct command on the job except for "Cancelling" his own requests using "cancel" command. And also its safe the files are not directly meddled by end user on the files queued in request directory. That is the reason, "cancel" command was developed to give normal users to cancel the request. If the normal user finds the print job not suitable,better he/she cancels the job, modifies the file as required and fire the print again.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Senthil Kumar .A_1
Honored Contributor

Re: It possible for the spool file owner to read and modify in the spool file using vi ?

one more point Roxana,

The files in request directory is transient. By trantient I mean, the OS will be using these files to print it and remove the files from here. Lets say, u open one of the file using vi, and the os decides to print and delete, by the time u modify and safe. It could lead to a inconsistent state with unknow results. Thats the reason its left alone there and remove the file's manually as "root" if cancel -e fails or in case you want to flush the queue for a particular printer.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Roxana_4
Frequent Advisor

Re: It possible for the spool file owner to read and modify in the spool file using vi ?

For Arunvijai

ll /var/spool/lp/request/hp8150
total 64
-rw------- 1 lp lp 115 Feb 21 07:46 fA026lion
-rw------- 1 lp lp 105 Feb 21 07:52 fA027lion
-rw-r----- 1 lp lp 17 Feb 21 07:46 fA026lion
-rw-r----- 1 lp lp 151 Feb 21 07:52 fA027lion
$
lpstat
hp8150-26 roxa priority 0 Feb 21 07:46
myfile 17 bytes
hp8150-27 roxa priority 0 Feb 21 07:52
x 151 bytes
printer queue for hp8150
JetDirect lpd: no jobs queued on the port Auto
lion: hp8150: ready and waiting

I would like that another user also be able to modify these spool files.
For ex the "roxa" user to be able to modify these spool files.
Arunvijai_4
Honored Contributor

Re: It possible for the spool file owner to read and modify in the spool file using vi ?

Hi Roxana,

It is not possible to modify anyother than "root".

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Senthil Kumar .A_1
Honored Contributor

Re: It possible for the spool file owner to read and modify in the spool file using vi ?

Hi Roxana,

As of ur query, I understand that you want the user to modify the spool file in the request directory. That means, user should be able to modify it before it gets printed.

In a printer spooler system,when a user submits a job with the command "lp", the print job gets queued. From now on, the system admin user takes care of the queue, and normal user would not have a direct command on the job except for "Cancelling" his own requests using "cancel" command. And also its safe the files are not directly meddled by end user on the files queued in request directory. That is the reason, "cancel" command was developed to give normal users to cancel the request. If the normal user finds the print job not suitable,better he/she cancels the job, modifies the file as required and fire the print again.

The files in request directory is transient. By trantient I mean, the OS will be using these files to print it and remove the files from here. Lets say, u open one of the file using vi, and the os decides to print and delete, by the time u modify and save. It could lead to a inconsistent state with unknown results. Thats the reason its left alone there and remove the file's manually as "root" if cancel -e fails or in case you want to flush the queue for a particular printer.


regards,
Senthil

P.S : why there is a duplicate thread on this Roxana, its queit ambiguaous which answer u are following.
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Roxana_4
Frequent Advisor

Re: It possible for the spool file owner to read and modify in the spool file using vi ?

I'am sorry because is a duplicate thread on this Roxana.