How to write a shell script and How to execute that scripts in OpenPBS?

We have written a script for licenses checking in shell script. But we don’t know to use that script in OpenPBS configuration file. how assign variable and value from the scripts to config file.

Please check this :slight_smile: How to manage Flexnet Licensing in PBS Pro? - #2 by adarsh

  • you can write a query script that retunrs only remaining amount of licenses from the respecitve application license server.

Hi adarsh,
Thanks for your quick reply.

We have done that steps.

We want write custom dyn_resource script. for example,
******** in schedule config file **********
all_lic !/usr/local/bin/check_license.sh
free_lic !/usr/local/bin/free_lic.sh

server_dyn_res:“all_lic free_lic”


that both variables should assign to one dyn_resource.
is it possible ?

that scripts output:
[root@sjrvlsiserver2 pbs]# ./license_check.sh
XT_XPLORER_SE
XT_XCC_TIE
XT_ISS_BASE
XTENSA_SDK
[root@sjrvlsiserver2 pbs]# ./free_lic.sh
2
2
2
2
[root@sjrvlsiserver2 pbs]#

Hi Ramesh,

each of the variable should be one server_dyn_res resource.

Hence you need to you have one per
XT_XPLORER_SE
XT_XCC_TIE
XT_ISS_BASE
XTENSA_SDK

XT_XPLORER_SE !/usr/local/bin/check_license_XT_XPLORER_SE.sh
XT_XCC_TIE !/usr/local/bin/check_license_XT_XCC_TIE.sh
XT_ISS_BASE /usr/local/bin/check_license_XT_ISS_BASE.sh
XTENSA_SDK /usr/local/bin/check_license_XTENSA_SDK .sh

or you can have a script and pass these varialbe as arguments to that script
server_dyn_res: “feature1 !/path/to/script [args]”

for example:
[root@sjrvlsiserver2 pbs]# ./free_lic.sh
2

and not

[root@sjrvlsiserver2 pbs]# ./free_lic.sh
2
2
2
2

Please note , any server dyn resource output should be just an integer and not a string and should have multiple new line characters

Please check this guide and below section

5.14.6.3.ii Example of Floating, Externally-managed License with Features

Hope this helps.