Set ulimit when using subprocess.Popen?

Discussion in 'Python' started by Jarek Zgoda, Jan 28, 2008.

  1. Jarek Zgoda

    Jarek Zgoda Guest

    Hi, all,

    anybody has an idea on how to set ulimit (-v in my case, linux) for
    process started using subprocess.Popen?

    --
    Jarek Zgoda
    Skype: jzgoda | GTalk: | voice: +48228430101

    "We read Knuth so you don't have to." (Tim Peters)
    Jarek Zgoda, Jan 28, 2008
    #1
    1. Advertising

  2. Jarek Zgoda

    Rob Wolfe Guest

    Jarek Zgoda napisa³(a):
    > Hi, all,
    >
    > anybody has an idea on how to set ulimit (-v in my case, linux) for
    > process started using subprocess.Popen?


    What about:

    from subprocess import call
    call('ulimit -v 1000 && ulimit -v && ls', shell=True)

    HTH,
    Rob
    Rob Wolfe, Jan 28, 2008
    #2
    1. Advertising

  3. Jarek Zgoda

    Jarek Zgoda Guest

    Rob Wolfe napisa³(a):
    >
    > Jarek Zgoda napisa³(a):
    >> Hi, all,
    >>
    >> anybody has an idea on how to set ulimit (-v in my case, linux) for
    >> process started using subprocess.Popen?

    >
    > What about:
    >
    > from subprocess import call
    > call('ulimit -v 1000 && ulimit -v && ls', shell=True)


    subprocess.Popen('ulimit -v 1024; ls', shell=True) works perfect.

    Unfortunately, the nature of ulimit impacts deadly my application when
    the limit is reached, so this knowledge is of no help in my case. ;)

    --
    Jarek Zgoda
    Skype: jzgoda | GTalk: | voice: +48228430101

    "We read Knuth so you don't have to." (Tim Peters)
    Jarek Zgoda, Jan 28, 2008
    #3
  4. Jarek Zgoda

    Rob Wolfe Guest

    Jarek Zgoda napisał(a):
    > Rob Wolfe napisa�(a):
    > >
    > > Jarek Zgoda napisa�(a):
    > >> Hi, all,
    > >>
    > >> anybody has an idea on how to set ulimit (-v in my case, linux) for
    > >> process started using subprocess.Popen?

    > >
    > > What about:
    > >
    > > from subprocess import call
    > > call('ulimit -v 1000 && ulimit -v && ls', shell=True)

    >
    > subprocess.Popen('ulimit -v 1024; ls', shell=True) works perfect.
    >
    > Unfortunately, the nature of ulimit impacts deadly my application when
    > the limit is reached, so this knowledge is of no help in my case. ;)


    Use "ulimit -v unlimited" then.

    RW
    Rob Wolfe, Jan 28, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Maciej Kalisiak

    "ulimit -s" has no effect?

    Maciej Kalisiak, Feb 5, 2004, in forum: Python
    Replies:
    16
    Views:
    2,125
    Josiah Carlson
    Feb 12, 2004
  2. Maxim Veksler

    ulimit on open sockets ?

    Maxim Veksler, Apr 10, 2007, in forum: Python
    Replies:
    6
    Views:
    518
    Alex Martelli
    Apr 14, 2007
  3. Greg Lindahl

    ulimit stack size and python threads

    Greg Lindahl, Jan 8, 2009, in forum: Python
    Replies:
    11
    Views:
    1,587
    Martin v. Löwis
    Jan 9, 2009
  4. Patrick Gundlach

    ulimit alike in ruby?

    Patrick Gundlach, Jul 29, 2004, in forum: Ruby
    Replies:
    9
    Views:
    438
    Patrick Gundlach
    Jul 29, 2004
  5. Kalaky
    Replies:
    0
    Views:
    253
    Kalaky
    Oct 26, 2004
Loading...

Share This Page