PDA

View Full Version : setpri, getpri and nicepri


cpitchford
09-13-2008, 05:42 PM
I've seen many links to tivo.samba.org all of which are no longer valid. I'm deperately trying to get hold of a copy of getpri and nicepri. I have setpri, but I can't find a copy of the other two tools anyway. Does anyone have a copy??

I'm still trying to solve a problem with vserver/mfs_ftp/tserver. When I pull a large recording off my tivo, the moment the client finishes the tivo will reboot. I'm working on a project to sync my tivo with my archos using a linux machine as a transcoding station. So far, so good. I have a modified copy of tyget and vstream-client that optionally limit the download speed (so as to ensure the current recording isn't interrupted/broken) and its uploads the results to my archos via wifi.. its all really good..

except.. my tivo reboots when a download finishes and I have no idea how to solve it. :(

I'd like to use getpri to see what priority other processes are running at

verses
09-14-2008, 01:10 PM
Hi I only have 'nice', attached, but no 'getpri'.

If it's any use to you this is the script I use with 'nice' to control dserver.tcl;

#!/bin/sh

nice -n +19 /var/hack/TySuiteJ/dserver.tcl 56178 &
running=`ps ux | grep dserver | grep -v grep | mawk {'print $2'}`
setpri ts 0 ${running}

Cheers,

Ian

cpitchford
09-14-2008, 04:21 PM
Thanks for the suggestion, I've already got nice..

Also, I've got a potential improvement on your code. Since the priority should be inherited by processes you could try, as an alternative. Setting the priority of the shell calling nice means dserver will run with an inheritied process


#!/bin/sh
setpri ts 0 $$
nice -n +19 /var/hack/TySuiteJ/dserver.tcl 56178 &


That way, the call to dserver.tcl will be nice and priority ts / 0
It saves an expensive call to grep and mawk and a late all to setpri

Just a suggestion

Cheers

Chris

verses
09-15-2008, 09:49 AM
Hi Chris,

Thanks for the suggested improvements; I'm pretty unfamiliar with nice and setpri, in fact all I've ever done with them is write that script, so hadn't thought about priority inheritance.
Now, I too would like a copy of getpri :)

Cheers,

Ian