Results 1 to 3 of 3

Thread: Process name of running script shows as just "sh"

  1. #1
    Join Date
    Jan 2009
    Location
    Millbury, MA
    Beans
    414
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question Process name of running script shows as just "sh"

    Under 9.10 I did the following:

    Added a custom application launcher to the panel which executes a script with the following command.
    Code:
    sh ~/Scripts/nvidia_freq.sh
    The script contains the following code.
    Code:
    #!/bin/bash
    while true; do
        if on_ac_power; then
            nice /usr/bin/nvidia-settings -q all > /dev/null
        fi
        sleep 25;
    done
    exit 0
    This keeps my nvidia card at maximum speed. (this is pretty commonly known and used). Then to let the card go back to adaptive clocking I had another panel launcher which simply killed the associated process with the following command.
    Code:
    killall nvidia_freq.sh
    and all worked as advertised. Under 10.04 it almost works except that I am unable to kill the process because its name is now listed as simply "sh" whether I use system-monitor, top, or ps to view it. And I can't "killall sh" because it is not the only process showing with that name. The only discernable difference between them is the PID # of the process, which my panel launcher icon has no way of knowing about.

    Any idea why the difference in behaviour between Karmic and Lucid? And what can I do about it?

    Thanks in advance,

    tgeer
    "Programming is an art form that fights back."

    HP Pavillion DV9500T 17" Notebook • 2.2GHz Core2 Duo • 4GB RAM • Nvidia Geforce 8600M GS 512MB
    Running Ubuntu 10.04 [64-bit]+Gnome+Compiz from HD / Puppy Linux 4.2.1SMP in RAM from USB Flash

  2. #2
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: Process name of running script shows as just "sh"

    Remove the sh from the start of the application launcher. What the application launcher is currently doing is running sh, and passing that script as a parameter, so the running process is sh, not nvidia_freq.sh.
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

  3. #3
    Join Date
    Jan 2009
    Location
    Millbury, MA
    Beans
    414
    Distro
    Ubuntu 10.04 Lucid Lynx

    Talking Re: Process name of running script shows as just "sh"

    Quite right you are, WorMzy - and thanks for the fast response.
    Odd, though. I could swear that is the command that I'm using in Karmic (with the 'sh'). Next time I'm at my 9.10 machine (at work) I'll have to check that.

    Anyway, all is well now.

    Thanks again,

    tgeer
    "Programming is an art form that fights back."

    HP Pavillion DV9500T 17" Notebook • 2.2GHz Core2 Duo • 4GB RAM • Nvidia Geforce 8600M GS 512MB
    Running Ubuntu 10.04 [64-bit]+Gnome+Compiz from HD / Puppy Linux 4.2.1SMP in RAM from USB Flash

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •