How to cancel print job by other user? + more problem
My print job on unix submit by user "applae3". I want other user cancel job of user applae3.
I know user can cancel job by owner and root user. But In this case,
I want give response for cancel print job to user "ctrlprt".
Because I will force user "ctrlprt" use only menu(create by shell script) automatic after him login(in .profile).
For these purpose, I'm setting in .profile of user "ctrlprt" to
HOME=/export/home/ctrlprt
$HOME/menu.sh
exit
and my 2 shell script
1. menu.sh (It's call cancel_prt.sh)
2. cancel_prt.sh
echo "Enter printer name \c"
read j
for i in `lpstat -o $j|awk '{print $1}'`;
do
/usr/bin/cancel $i
done
After I'm login to user ctrlprt. It's can use menu, But can't cancel job (Permission denied).
Then, I'm use RBAC feature (BigAdmin Submitted Article: Custom Roles Using RBAC in the Solaris OS)
for set permission like root on "/usr/bin/cancel" to role "prt_r" and give role to user ctrlprt.
I'm testing by login to user ctrlprt --> login to role prt_r --> test cancel printjob --> result it OK.
However, I still can't get my objective. I found 2 problem:
1.If user ctrlprt want to cancel role. He must login to role prt_r first. (I add "su - prt_r" in first line of cancel_prt.sh)
Then, It's not automic. User ctrlprt must enter password. How to bypass this operation?
2.After login to role prt_r, user ctrlprt can cancel printjob by use command line /usr/bin/cancel.
but If call shell script cancel_prt.sh (which is have same cancel command (see script above)), It's can't cancel (Permission Denied). Why? and How to do solve?
Please suggest me...., I'm a beginner of Unix Administrator.
Thank you very much.

