Author Topic: /sbin/survive  (Read 4524 times)

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
/sbin/survive
« on: March 11, 2004, 09:17:03 am »
Anyone has a source code of the little bugger? I think it was available as a download on Sharp developer website ages ago....
-albertr

Anonymous

  • Guest
/sbin/survive
« Reply #1 on: March 11, 2004, 10:40:02 am »

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
/sbin/survive
« Reply #2 on: March 11, 2004, 02:13:06 pm »
Thanks!
-albertr

havoc

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • http://www.galacticslacker.com/
/sbin/survive
« Reply #3 on: March 11, 2004, 02:21:33 pm »
so, what is \"survive?\"

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
/sbin/survive
« Reply #4 on: March 12, 2004, 10:28:43 pm »

albertr@sharky:/mnt/net/zaurus/src$ ./survive -h

usage: survive [ [-i] [-l <level>] command ...]

    When kernel is compiled with CONFIG_OOM_KILL_SURVIVAL=y option,
    if memory becomes dangerously low, instead of panicing, kernel
    will try to free up memory by killing processes.

    The processes to be killed will be choosen based on their survival
    level, where:
        0  - no survival level was set (most likely to be killed)
        15 - lowest level (more likely to be killed)
        ...
        1 - highest level (least likely to be killed)
    The survival level is set with the \"-l\" option.
    The \"-i\" option (if provided) direct child processes to inherit
    the survival level of the parent.



-albertr

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
/sbin/survive
« Reply #5 on: March 12, 2004, 10:48:29 pm »
Here\'s an example:

albertr@sharky:/mnt/net/zaurus/src$ ./survive
survive: current inherit: 1, level: 5
albertr@sharky:/mnt/net/zaurus/src$ ./survive -i -l 10 bash
survive: changing to inherit: 1, level: 10
survive: executing command: bash
albertr@sharky:/mnt/net/zaurus/src$ ./survive
survive: current inherit: 1, level: 10
albertr@sharky:/mnt/net/zaurus/src$ exit
exit
albertr@sharky:/mnt/net/zaurus/src$ ./survive
survive: current inherit: 1, level: 5
albertr@sharky:/mnt/net/zaurus/src$


-albertr

havoc

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • http://www.galacticslacker.com/
/sbin/survive
« Reply #6 on: March 13, 2004, 12:55:21 am »
thanks, albertr.

I attemped to edit my icon for KO/pi so that kopi would start with survive 12, but I keep getting \"This program is not found.\"

I used:
/sbin/survive -i -l 12 /home/QtPalmtop/bin/kopi
survive -i -l 12 kopi
/sbin/survive -i -l 12 kopi
\'/sbin/survive -i -l 12 /home/QtPalmtop/bin/kopi\'
\'/sbin/survive -i -l 12 kopi\'

....

is there any way to start the app from the launcher with survive?

I\'m pretty sure I\'m just looking past something.

thanks,
havoc

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
/sbin/survive
« Reply #7 on: March 13, 2004, 08:43:21 am »
You can always try a one line shell wrapper script.
-albertr

havoc

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • http://www.galacticslacker.com/
/sbin/survive
« Reply #8 on: March 13, 2004, 10:54:51 am »
oh.... duh!  Yep, just \"walked right past that.\"
-havoc