View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 5 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: Mythcommflag Priority
PostPosted: Sun Jan 07, 2007 8:08 pm 
Offline
Joined: Sat Apr 08, 2006 2:13 am
Posts: 40
It seems the default priority for 'low' CPU priority of mythcommflag (as can be set in the MythTV) is a nice priority of 17. I have to manually change it to 19 to ensure system stability. How do I change the default value from 17 to 19?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 07, 2007 8:59 pm 
Offline
Joined: Fri Nov 18, 2005 9:22 am
Posts: 777
Location: spencerport, ny (USA)
You can't. It's hard-coded way down deep in the program. I went looking one day, and it looked like it was turning into a big job. I'm hoping to get time to write a script to look for the commflag job and knock its value back to 19, but haven't gotten to it yet.
I may instead turn off the automatic one, and run commflag from crontab. This would give me flexibility in scheduling, so I could run from midnight-8:00, then again from 10AM -7PM M-F, but not on weekends. i.e. have it run when I'm never watch TV. I can get more flexibilty this way.
OTOH, this is just my "bright idea for today", and I may get distracted by some other shiny object tomorrow.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 10, 2007 11:10 pm 
Offline
Joined: Sat Apr 08, 2006 2:13 am
Posts: 40
Yeah, I just made a lil C++ script to automatically renice it and have it set to run in cron every minute.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 4:50 pm 
Offline
Joined: Wed Apr 28, 2004 10:42 pm
Posts: 405
Location: Bendigo, Victoria, Australia
Would you mind posting that script as I have had the same problem.

Thanks,

_________________
Paul Turpie
-------------
<--Is your location in your profile? Why not?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 17, 2007 12:13 am 
Offline
Joined: Sat Apr 08, 2006 2:13 am
Posts: 40
I'm sure there's a much, much much better way of doing this but I'm not much of a programmer so my solution was just to run this via a cronjob every minute.

Code:
#include <string>
#include <iostream>
#include <fstream>

using namespace std;

int main(){

  system("ps -e | grep mythcommflag > temp");
  system("du temp > temp2");
  int du = 0;
  ifstream disk("temp2");
  disk >> du;
  if(du == 0){
    return 0;
  }
  ifstream file("temp");
  char pid[10] = "";
  file >> pid;
  //  cout << "Pid is: " << pid << endl << endl;
  char command[255] = "renice 19 -p ";
  strncat(command, pid, 10);
  //  cout << "Command is: " << command << endl << endl;
  system(command);
  system("rm temp");
  system("rm temp2");
  return 0;

}


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu