IBM i Global

IBM i 

A space for professionals working with IBM’s integrated OS for Power systems to exchange ideas, ask questions, and share expertise on topics like RPG and COBOL development, application modernization, open source integration, system administration, and business continuity.


#Power


#IBMi
 View Only
  • 1.  concurrent call of listWebServicesServers.sh creating contention

    Posted Fri May 24, 2024 07:14 AM
    I am trying to use shell command listWebServicesServers.sh to get status of IWS servers on IBMi. There are 2 IWS servers on our IBMi. 
    We have executing 2 separate jobs to monitor status of 2 IWS servers. We faced a scenario when both these 2 jobs try to execute shell command 
    listWebServicesServers.sh approximately at same time , sometime 1 job and sometimes both the jobs get hanged in TIMW status. 
    In our job, we call shell command listWebServicesServers.sh using QCMDEXC. The users of these 2 jobs are same and have required authority to run this command.
    At times, when these command are executed at different times in both these jobs, we dont get this contetion issue. We tried to hold one job and monitored other job. In that case there is no contention issue.
    So we think hand issue is coming when the same shell command is executed as same time by both the jobs.
     
    Did anyone face this issue. Any issue with underlying java program ?


    ------------------------------
    Sarfaraj Pirjade
    ------------------------------


  • 2.  RE: concurrent call of listWebServicesServers.sh creating contention

    Posted Fri May 24, 2024 09:27 AM

    Dear Sarfaraj

    How about checking if the file  /QIBM/ProdData/OS/WebServices/bin/listWebServicesServers.sh is being used or not before running it?  I figure you can use IBM i service  QSYS2.IFS_OBJECT_LOCK_INFO ( https://www.ibm.com/docs/en/i/7.4?topic=services-ifs-object-lock-info-table-function ) to do this check. (This service is available as of IBM i 7.3 with a certain level of group PTF.)  If it returns a null value (no job is using it), then you run the shell command.  If it does not return a null, then do DLYJOB for 1 or 2 seconds and do the check again. 



    ------------------------------
    Satid S
    ------------------------------



  • 3.  RE: concurrent call of listWebServicesServers.sh creating contention

    Posted Mon May 27, 2024 02:42 AM

    Thank you very much Satid for your response. I just tried the IBMi SQL service. It gives me return if someone is locking it. So I can handle it programmatically.

    But Wondering why would shell script be locked if someone is running it. Isn't it same like multiple jobs calling same program concurrently without lock?

    Is this a limitation or normal to have such lock. Thank you



    ------------------------------
    Sarfaraj Pirjade
    ------------------------------



  • 4.  RE: concurrent call of listWebServicesServers.sh creating contention

    Posted Mon May 27, 2024 08:56 PM
    Edited by Satid S Mon May 27, 2024 09:15 PM

    Dear Sarfaraj

    >>>> But Wondering why would shell script be locked if someone is running it. Isn't it same like multiple jobs calling same program concurrently without lock? <<<<

    In IBM i QSYS file system, a *PGM object is distinct from a *FILE object but this is not so in IFS that comes from UNIX/PC world in which every thing is just a file - no distinction here. 

    But in any OS, file locking control is a crucial feature for managing access in multi-user environment. For example in IBM i QSYS file system, you can use ALCOBJ command to specify different manners of object locking for your job. But I'm not as familiar with IFS environment in this respect.  If you happen to know any equivalent UNIX shell command to ALCOBJ, you may try it from your Java program.  I hope such a control should be available in UNIX/IBM i Qshell.  Or you might want to ask a new question on whether an equivalent of ALCOBJ for IFS file is available for use from Qshell.



    ------------------------------
    Satid S
    ------------------------------



  • 5.  RE: concurrent call of listWebServicesServers.sh creating contention

    Posted Mon May 27, 2024 09:29 PM

    I just find the command RLSIFSLCK and you may want to try to see if it works for you or not (try it with a dummy file first and make a copy of listWebServicesServers.sh file before you try with it): Release Integrated File System Locked Files at  https://www.ibm.com/support/pages/release-integrated-file-system-locked-files        



    ------------------------------
    Satid S
    ------------------------------



  • 6.  RE: concurrent call of listWebServicesServers.sh creating contention

    Posted Thu April 10, 2025 08:30 AM

    Hi Sarfaraj,

    Have you looked into or considered using' SELECT * FROM HTTP_SERVER_INFO' as a possible way to monitor? Another low-tech method could be to simply monitor the active jobs if your services are in the Default subsystem. The underlying call in the listWebServicesServers.sh script uses Java , so one must wait for the JVM to start before firing that up. This could lead to problems, as you would have to wait for the JVM to start while trying to access the same resource that the classes are internally calling on. 



    ------------------------------
    Marius le Roux theIBMiGuy
    Owner , IBM i Consultant & Technology Strategist
    MLR Consulting
    Port Alfred
    ------------------------------