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. Advertisements

  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. Advertisements

  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. Advertisements

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. William Hudspeth
    Replies:
    2
    Views:
    415
    Fabio FZero
    Mar 15, 2007
  2. William Hudspeth
    Replies:
    1
    Views:
    509
    Sion Arrowsmith
    Mar 16, 2007
  3. Replies:
    2
    Views:
    819
    Matt Nordhoff
    Jul 10, 2008
  4. Gabriel Genellina

    Re: Defunct when using subprocess.Popen

    Gabriel Genellina, Jul 30, 2008, in forum: Python
    Replies:
    1
    Views:
    776
    Bruce Frederiksen
    Jul 30, 2008
  5. Mark Shewfelt
    Replies:
    1
    Views:
    853
    yomgui
    Nov 6, 2008
  6. enda man
    Replies:
    1
    Views:
    1,574
    Nobody
    Mar 5, 2010
  7. Steven
    Replies:
    7
    Views:
    1,398
    Dennis Lee Bieber
    Sep 13, 2012
  8. Atherun
    Replies:
    18
    Views:
    4,123
    Atherun
    Sep 24, 2011
Loading...