PBS command to see other users job from user environment

Hi,
I am having some problems with qstat. As as user with no privileges (manager, operator), I cannot see other users submited jobs on the server queues. Only the root is able to.
What are the requirements for the users to be able to see each others jobs on the qstat command?

Thanks

Regards,
Praveen

As mentioned here, you have to -

qmgr: set server query_other_jobs = True

Thanks,
Prakash

1 Like

Hi,

Thanks for the reply.
Just I need to execute the above command from CLI right? or should I put it in some PBS configuration file.
Please correct me.

Also can I use below command from CLI
qmgr -c “set server query_other_jobs = True”

Regards,
Praveen

1 Like

This will also work.

Hi,

After executing above qmgr command, it’s true that “qstat -a” command will list all user’s job from user environment.

Thanks

Thank you for confirming.

Hi,

Sorry for wrong typo. My question is "After executing above qmgr command, Is it true that “qstat -a” command will list all user’s job from user environment?

please read my query again.

Thanks

Okay. The answer to your question is yes.

Below is an example -

[test1@d_server /]$ qsub – /bin/sleep 1111
999.d_server
[test1@d_server /]$ qstat -s

d_server:
Req’d Req’d Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time


999.d_server test1 workq STDIN 1623 1 1 – – R 00:00
Job run at Tue Nov 14 at 18:13 on (d_server:ncpus=1)
[test1@d_server /]$ exit
[root@d_server /]# qsub – /bin/sleep 1111
1000.d_server
[root@d_server /]# qstat
Job id Name User Time Use S Queue


999.d_server STDIN test1 00:00:00 R workq
1000.d_server STDIN root 00:00:00 R workq
[root@d_server /]# su test1
[test1@d_server /]$ qstat -a

d_server:
Req’d Req’d Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time


999.d_server test1 workq STDIN 1623 1 1 – – R 00:00
1000.d_server root workq STDIN 1629 1 1 – – R 00:00
[test1@d_server /]$ qmgr -c “p s” | grep query
set server query_other_jobs = True
[test1@d_server /]$ exit
[root@d_server /]# qmgr -c “set server query_other_jobs = False”
[root@d_server /]# qstat
Job id Name User Time Use S Queue


999.d_server STDIN test1 00:00:00 R workq
1000.d_server STDIN root 00:00:00 R workq
[root@d_server /]# su test1
[test1@d_server /]$ qstat
Job id Name User Time Use S Queue


999.d_server STDIN test1 00:00:00 R workq
[test1@d_server /]$ qstat -a

d_server:
Req’d Req’d Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time


999.d_server test1 workq STDIN 1623 1 1 – – R 00:01
[test1@d_server /]$

Hope this helps…

Hi,

Thanks for the proper guidance.

I will confirm you if it works in our cluster.

Hi,

It worked. We can able to see other users job. Thanks.

thank you for informing…

My problem is common user can see other users job by qstat command,
So I use qmgr -c “set server query_other_jobs = False” to disable this function
If common user can see other users job, that user can alse delete other users job,we should avoid this

Hello, the query_other_jobs status is independent for whether or not a user can delete another user’s job. The pbs_server will do a system ruserok() check when user1 tries to delete user2’s job, and unless user2 has explicitly allowed this (via something that ruserok() checks, like the would-be impersonated user’s .rhosts file for example) it will be rejected.

Example where user2 has specifically allowed user1 to ad on his behalf from the PBS server host, but user1 has not done the same:

[root@centos7-2 pbs]# qmgr -c "p s query_other_jobs"
#
# Set server attributes.
#
set server query_other_jobs = True
[root@centos7-2 pbs]# qstat
Job id            Name             User              Time Use S Queue
----------------  ---------------- ----------------  -------- - -----
4858.centos7-2    STDIN            user1                    0 Q workq
4860.centos7-2    STDIN            user2                    0 Q workq



[user1@centos7-2 ~]$ cat .rhosts
cat: .rhosts: No such file or directory

[user2@centos7-2 ~]$ cat .rhosts
+ user1 centos7-2.prog.altair.com


[user1@centos7-2 ~]$ qdel 4859
[user1@centos7-2 ~]$

[user2@centos7-2 ~]$ qdel 4858
qdel: Unauthorized Request  4858.centos7-2