AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
  • 1.  need a script that will change the limits in the /etc/security/limits file

    Posted Tue March 18, 2008 03:59 PM

    Originally posted by: SystemAdmin


    I need a script that will change the limits in the /etc/security/limits file. Primarily the files limit must be unlimited (-1). I have a list of server names that I would like to tie into the script. Each server will be accessed via remsh. Also will I need to reboot in order for the changes take place or can I just restart a service?

    Any help is appreciated.

    Thank you,

    Paul Romanek
    #AIX-Forum


  • 2.  Re: need a script that will change the limits in the /etc/security/limits f

    Posted Tue March 18, 2008 04:08 PM

    Originally posted by: esv


    You can use perl, sed, awk to edit the file but I believe the correct method should be to manually change the value for the default stanza then change the value of the attribute via the chuser command on a user by user basis.

    best regards,
    enrique.
    #AIX-Forum


  • 3.  Re: need a script that will change the limits in the /etc/security/limits f

    Posted Tue March 18, 2008 05:56 PM

    Originally posted by: SystemAdmin


    Can anyone give me examples of how you would write the script rather than what you would write it in. Also any way of automatting this proccess.
    #AIX-Forum


  • 4.  Re: need a script that will change the limits in the /etc/security/limits f

    Posted Wed March 19, 2008 06:00 PM

    Originally posted by: kappa


    chsec is your friend. (better than chuser for this task)
    use remsh/rsh/ssh ... it's your choice
    you can reboot OR restart some services ... it's your choice.
    Please, could you repeat the question with other words?
    #AIX-Forum


  • 5.  Re: need a script that will change the limits in the /etc/security/limits f

    Posted Wed March 19, 2008 06:12 PM

    Originally posted by: SystemAdmin


    What services would need to be restarted to avoid a reboot. I have also place a copy of the scripted I created in the message. Any suggestions? Just to clarify this script is ran on a HP-UX server but is connecting to a bunch of AIX 5.2 servers.

    #! /bin/sh
    for sys in $(<Bad_servers.test); do
    remsh $sys -n "cp /etc/security/limits /etc/security/limits.old; u limit -1 > ul
    imit.change.log 2>&1"
    done
    #AIX-Forum


  • 6.  Re: need a script that will change the limits in the /etc/security/limits f

    Posted Wed March 19, 2008 06:24 PM

    Originally posted by: kappa


    better use chsec:
    http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds1/chsec.htm
    chsec -f /etc/security/limits -s default -a fsize=-1
    chsec -f /etc/security/limits -s root -a fsize=-1
    The limits are evaluated every time you read the environment (during login or /bin/su -).
    Just stop and start Oracle, logout&login etc.
    #AIX-Forum