AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
Expand all | Collapse all

Ulimit value is getting changed when switching the shell

  • 1.  Ulimit value is getting changed when switching the shell

    Posted Sun May 05, 2019 06:52 AM

    Originally posted by: CTSUnix


    #ulimit -a
    core file size          (blocks, -c) 1048575
    data seg size           (kbytes, -d) 2097152
    file size               (blocks, -f) unlimited
    max memory size         (kbytes, -m) unlimited
    open files                      (-n) unlimited
    pipe size            (512 bytes, -p) 64
    stack size              (kbytes, -s) hard
    cpu time               (seconds, -t) unlimited
    max user processes              (-u) 16384
    virtual memory          (kbytes, -v) unlimited



  • 2.  Re: Ulimit value is getting changed when switching the shell

    Posted Mon May 06, 2019 01:36 AM

    Originally posted by: CTSUnix


    Hello Experts,

    Ulimit value (data seg size and max user process) is getting changed when switching the shell from ksh to bash in AIX 7.1.

    Please find the below output for your reference.

    elrep:!:604:207:Application User:/elappbin/elrep:/usr/bin/ksh

    #id

    uid=604(elrep) gid=207(comptel) groups=1(staff)

    #ulimit -a
    time(seconds)        unlimited
    file(blocks)         unlimited
    data(kbytes)         unlimited
    stack(kbytes)        4194304
    memory(kbytes)       unlimited
    coredump(blocks)     2097151
    nofiles(descriptors) unlimited
    threads(per process) unlimited
    processes(per user)  unlimited

    #bash

    #id

    uid=604(elrep) gid=207(comptel) groups=1(staff)

    #ulimit -a
    core file size          (blocks, -c) 1048575
    data seg size           (kbytes, -d) 2097152
    file size               (blocks, -f) unlimited
    max memory size         (kbytes, -m) unlimited
    open files                      (-n) unlimited
    pipe size            (512 bytes, -p) 64
    stack size              (kbytes, -s) hard
    cpu time               (seconds, -t) unlimited
    max user processes              (-u) 16384
    virtual memory          (kbytes, -v) unlimited

    Let me know, how to keep the same ulimit value (data seg size  & max user process) for a user in ksh and bash shell.



  • 3.  Re: Ulimit value is getting changed when switching the shell

    Posted Tue May 07, 2019 06:03 AM

    Originally posted by: AyappanP


    We will look into this.

    In the meanwhile, i think you can use .bashrc & .kshrc file to maintain the same values for the user.



  • 4.  Re: Ulimit value is getting changed when switching the shell

    Posted Wed May 08, 2019 03:33 AM

    Originally posted by: CTSUnix


    Hi,

     

    Thanks for your support.

     

    Can you please let me know, how can I set ulimit values in .bashrc file.



  • 5.  Re: Ulimit value is getting changed when switching the shell

    Posted Wed May 08, 2019 04:48 AM

    Originally posted by: AyappanP


    Just put it like this.

    ulimit -d unlimited

    ulimit -u unlimited 



  • 6.  Re: Ulimit value is getting changed when switching the shell

    Posted Tue May 14, 2019 02:31 AM

    Originally posted by: CTSUnix



    Thanks for your suggestions.

    I have set the ulimit value as suggested in .bashrc file. For "ulimit -d" it got changed to unlimited.

    But for "ulimit -u" it is not getting changed and getting the notification "bash: ulimit: max user processes: cannot modify limit: A system call received a parameter that is not valid" message while switching to bash shell.

    Please fidn the below output for your reference and let me know, hwo to fix it.

    user@PEC:/home/user>#cat .bashrc
    ulimit -d unlimited
    ulimit -u unlimited
    user@PEC:/home/user>#

    user@PEC:/home/user>#echo $0
    -ksh
    user@PEC:/home/user>#ulimit -d
    unlimited
    user@PEC:/home/user>#ulimit -u
    unlimited
    user@PEC:/home/user>#bash
    bash: ulimit: max user processes: cannot modify limit: A system call received a parameter that is not valid.
    user@PEC:/home/user>#echo $0
    bash
    user@PEC:/home/user>#ulimit -d
    unlimited
    user@PEC:/home/user>#ulimit -u
    16384
    user@PEC:/home/user>#



  • 7.  Re: Ulimit value is getting changed when switching the shell

    Posted Tue May 14, 2019 04:46 AM

    Originally posted by: AyappanP


    Which version of bash is installed ?

    rpm -qa | grep bash

    bash --version 



  • 8.  Re: Ulimit value is getting changed when switching the shell

    Posted Thu May 16, 2019 04:57 AM

    Originally posted by: CTSUnix


    user@PEC:/>#rpm -qa |grep -i bash
    bash-4.4-4
    user@PEC:/>#bash --version
    GNU bash, version 4.4.12(1)-release (powerpc-ibm-aix5.1.0.0)
    Copyright (C) 2016 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

     



  • 9.  Re: Ulimit value is getting changed when switching the shell

    Posted Thu May 16, 2019 05:08 AM

    Originally posted by: AyappanP


    The bash you are using is not from AIX Toolbox. 

    Can you try the latest bash 5.0 from AIX Toolbox and check whether the problem exists ?



  • 10.  Re: Ulimit value is getting changed when switching the shell

    Posted Thu May 16, 2019 07:57 AM

    Originally posted by: CTSUnix


    Hi,

    When I'm trying to install the (bash-5.0-1.aix6.1.ppc.rpm) it is asking for multiple dependency packages.

    Kindly let me know, is there any option to fix (ulimit -u issue) in current version.



  • 11.  Re: Ulimit value is getting changed when switching the shell

    Posted Thu May 16, 2019 08:14 AM

    Originally posted by: AyappanP


    In the current bash 5.0, i see the ulimit -u ie., the max user process ulimit value gets inherited from ksh shell. 

    I am not sure why it is not happening in your bash 4.4 version. And max user process limit you can increase only with root privileges. 



  • 12.  Re: Ulimit value is getting changed when switching the shell

    Posted Thu May 16, 2019 10:19 PM

    Originally posted by: CTSUnix


    Getting below mentioned package dependencies while trying to install bash-5.0-1

     

    root@:/mnt/aix/bash>#rpm -hUv bash-5.0-1.aix6.1.ppc.rpm
    error: failed dependencies:
            libiconv >= 1.14-1 is needed by bash-5.0-1
            libiconv.a(libiconv.so.2)   is needed by bash-5.0-1
    root@PEC:/mnt/aix/bash>#rpm -ivh libiconv-1.14-1.aix6.1.ppc.rpm
    error: failed dependencies:
            gettext >= 0.19.8.1-1 is needed by libiconv-1.14-1
            libintl.a(libintl.so.8) is needed by libiconv-1.14-1

     

    And max user process limit you can increase only with root privileges.

    ==> It is unlimited for root and other users in kshell, but not getting inherited for bash shell. I have put the "ulimit -u unlimited" in my current user home directory bash shell. Then I'm getting this notification "bash: ulimit: max user processes: cannot modify limit: A system call received a parameter that is not valid." while changing the shell from ksh to bash. Any idea, how to fix it.

     

    Let me know, how to fix the package dependency issue while upgrading to bash -5.0-1.



  • 13.  Re: Ulimit value is getting changed when switching the shell

    Posted Fri May 17, 2019 06:00 AM

    Originally posted by: AyappanP


    Please use Yum to install packages. It will automatically resolve the dependencies. 

    How to configure yum in AIX --> https://developer.ibm.com/articles/configure-yum-on-aix/



  • 14.  Re: Ulimit value is getting changed when switching the shell

    Posted Mon May 20, 2019 02:34 AM

    Originally posted by: CTSUnix


    Thanks alot for your support and solution.

    Ulimit vlalue inheritance issue was due to bug in current bash version. After upgrading the same to bash-5.0-1, issue got fixed.

    I have used below order to resolve the package dependency issue during bash package upgrade. Because yum has not configured in our setup.

    rpm -ivh gettext-0.19.8.1-3.aix6.1.ppc.rpm --nodeps
    rpm -ivh libiconv-1.14-1.aix6.1.ppc.rpm

    rpm -hUv bash-5.0-1.aix6.1.ppc.rpm