Changeset 106


Ignore:
Timestamp:
May 14, 2014, 7:26:58 PM (10 years ago)
Author:
g7moreau
Message:
  • More generic solution for ulimit and add doc (oar-envsh)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oarutils/oar-envsh

    r105 r106  
    1111# 1.1 Patrick Begou  (all the environment excepted... that could make problems!)
    1212# 1.2 Gabriel Moreau (format, small bug and licence)
     13# 1.3 Gabriel Moreau (add initial support for ulimit)
    1314#
    1415
     
    1617shift
    1718
    18 ulimit_s=$(ulimit -s)
    19 ulimit_n=$(ulimit -n)
    20 ulimit_l=$(ulimit -l)
     19MYLIMIT=""
     20for option in 's' 'l' 'n'
     21do
     22   myvalue=$(ulimit "-$option")
     23   [ -n "$myvalue" ] && MYLIMIT="${MYLIMIT} ulimit -$option $myvalue;"
     24done
    2125
    2226MYENV=$( env \
     
    3135   | tr [\\\n] [\;] )
    3236
    33 exec /opt/oar/current/bin/oarsh $HOST "ulimit -s ${ulimit_s}; ulimit -n ${ulimit_n}; ulimit -l ${ulimit_l}; $MYENV $@"
     37exec /opt/oar/current/bin/oarsh $HOST "$MYLIMIT $MYENV $@"
    3438
    3539exit
     
    6266 SHLVL
    6367
     68With C<oar-envsh>, some ulimit are also transfert in the new shell.
     69Actually, we only transfert:
     70
     71 -l locked memory
     72 -n open files
     73 -s stack size
     74
    6475Alway use C<oarsh>,
    6576only use C<oar-envsh> if really needed!
     
    8394GPL version 2 or later
    8495
    85 Copyright (C) 2011 Patrick Begou / LEGI - CNRS UMR 5519 - France
     96Copyright (C) 2011-2014 Patrick Begou / LEGI - CNRS UMR 5519 - France
    8697
    8798=cut
Note: See TracChangeset for help on using the changeset viewer.