Qmgr access to hooks data


I am getting started with pbs hooks, and when I run

sudo qmgr -c "print hook"

I get the following:

qmgr obj= svr=default: root@login-01.cm.cluster is unauthorized to access hooks data from server headnode.cm.cluster
qmgr: hook error returned from server

From the manual:

*If qmgr is invoked, and the object being operated on is "hook", and the executing user at some host does not have access*
*to the target server's private location for hooks data, then the following error is issued to stderr and server logs:*
"<user>@<host> is unauthorized to access hooks data from server <hostname>"

Which has me confused.

How do I find where the hooks data is stored and figure out why root doesn’t have access?


You can find the hooks and its configuration files here
source /etc/pbs.conf;cd $PBS_HOME/server_priv/hooks

It is the /etc/hosts file and the DNS resolution of the hostname given for PBS_SERVER in the /etc/pbs.conf file. Make necesary adjustments in /etc/hosts to get the qmgr -c “print hook” working.

  • check the $PBS_HOM/server_logs/YYYYMMDD for the corresponding logs, when you run qmgr -c “print hook” command.

Thanks @adarsh - I have found the hooks folder, thanks for that. And I can read the hook files in there when root, so I am not sure why the qmgr command is not working. It doesn’t really look like there is much reported in the server log files, at least to my untrained eye…

What are the changes that need to be made to the /etc/hosts file?

You should have seen some message coming from different IP

On the command line as root user
export PBS_SERVER=hostname-of-the-server-that-you-get-by-typing-hostname-cmd
qmgr -c “list hook”

Thanks @adarsh - git it sorted. Machine that I was on is named very similar to $PBS_SERVER, so I wasnt running on the server.

1 Like