Results 1 to 5 of 5

Thread: permanently change priority of process

  1. #1
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    4,140
    Distro
    Xubuntu 13.04 Raring Ringtail

    permanently change priority of process

    gmusicbrowser seems to skip or stop playing for a moment when i do somethings
    i changed the priority to see if it made a difference and it appears it did but i don't know how to make it permanent
    Code:
    sudo renice -n  -13 2888
    only way i can think of would be to do this from a script that runs as root
    Code:
    renice -n  -13 $(pgrep -f /usr/bin/gmusicbrowser)
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  2. #2
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: permanently change priority of process

    You could edit the /usr/share/applications/gmusicbrowser.desktop file and change the Exec line to something like:
    Code:
    Exec=nice -n -13 gmusicbrowser
    This will launch the application with default nice value incremented by -13.
    Cheesemill

  3. #3
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: permanently change priority of process

    OK, scratch that idea. It still needs to be run as root to have any effect.

    I'll keep thinking
    Cheesemill

  4. #4
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: permanently change priority of process

    It's a bit of an ugly hack but you could always run the command you gave in your first post from roots crontab every minute or so.

    I'm sure the must be a better way, I'll get back to you if I can figure out what it is.
    Cheesemill

  5. #5
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    4,140
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: permanently change priority of process

    This would be nicer i think, i was hoping for a config file for settings default priorities for processes
    Code:
    chad@Quantal-Desktop:~$ cat /etc/lightdm/lightdm.conf 
    [SeatDefaults]
    greeter-session=lightdm-gtk-greeter
    user-session=xubuntu
    #display-setup-script=
    greeter-setup-script=sh -c "/usr/local/bin/greeter-setup-script &"
    session-setup-script=sh -c "/usr/local/bin/session-setup-script &"
    session-cleanup-script=/usr/local/bin/session-cleanup-script
    chad@Quantal-Desktop:~$ sudo nano /usr/local/bin/session-setup-script
    [sudo] password for chad: 
    chad@Quantal-Desktop:~$ cat /usr/local/bin/session-setup-script | tail -5
    while [ -z "$pid" ];do
        pid=$(pgrep -f /usr/bin/gmusicbrowser)
        sleep 3
    done
    renice -n -13 $pid
    Last edited by pqwoerituytrueiwoq; December 14th, 2012 at 01:36 AM.
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

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
  •