Re: Default nice value setting

2009-06-17 Thread Faheem Pervez
Hi,

Incidentially, you may have found this bug useful once upon a time:
https://bugs.maemo.org/show_bug.cgi?id=374 *grin*

But, anyway, the line you want to search in that bug is setpriority()
which'll allow you to override the nice value from your app.

Regards,
Faheem

On Wed, Jun 17, 2009 at 5:28 AM, Nick Nobody m...@nikosapi.org wrote:

 Hi,

 Is there a way to specify a default nice value for an application on maemo?
 I
 noticed that if an application is launched by the menu directly from an
 executable (using the Exec variable in the .desktop file) it gets a nice
 value
 of -1. But, if the application is started over D-Bus (using the
 X-Osso-Service
 variable in the .desktop file) it gets a nice value of 0.

 The application I'm working on needs at least a nice value of -1 or else it
 becomes unusable. Is there a way to make this happen while still being able
 to
 start the application over D-Bus?

 Thanks,

 nick
 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Default nice value setting

2009-06-17 Thread Frantisek Dufka
Nick Nobody wrote:
 if an application is launched by the menu directly from an 
 executable (using the Exec variable in the .desktop file) it gets a nice 
 value 
 of -1. But, if the application is started over D-Bus (using the 
 X-Osso-Service 
 variable in the .desktop file) it gets a nice value of 0.

Which OS version it is? This is a bug, both should have priority 0. Can 
you reopen that bug Faheem linked with details about your OS version if 
you see it on current OS version? Oh wait, maybe just forget it, it'll 
be WONTFIXed anyway for any current system :-)

Sadly I think that you cannot raise the priority from 0 to -1 unless 
being root, you can just lower it so that setpriority call may not help 
you. The scummvm problem in the bug was different, scummvm didn't like 
higher priority (or better said - system audio daemon didn't like 
scummvm having higher priority) so the solution was to lower the 
priority from -1 to 0 which worked for ordinary user.

Frantisek
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Default nice value setting

2009-06-17 Thread Henrik Hedberg
Frantisek Dufka wrote:

 Sadly I think that you cannot raise the priority from 0 to -1 unless 
 being root, you can just lower it so that setpriority call may not help 
 you.

If it is really crucial for the application to have higher priority, 
maybe it could be installed as setuid root. In that way, it could first 
set priority from 0 to -1, and then drop the privileges.

BR,

Henrik

-- 
Henrik Hedberg  -  http://www.henrikhedberg.net/
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Default nice value setting

2009-06-17 Thread Frantisek Dufka
Henrik Hedberg wrote:
 If it is really crucial for the application to have higher priority, 
 maybe it could be installed as setuid root. In that way, it could first 
 set priority from 0 to -1, and then drop the privileges.

Or postinstall script could add some helper to sudoers which could raise 
priority when started from inside the application. I think Vagalume uses 
this trick.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


WONTFIX BUGS.... was Re: Default nice value setting

2009-06-17 Thread David Greaves
Frantisek Dufka wrote:
 Which OS version it is? This is a bug, both should have priority 0. Can 
 you reopen that bug Faheem linked with details about your OS version if 
 you see it on current OS version? Oh wait, maybe just forget it, it'll 
 be WONTFIXed anyway for any current system :-)

Just thinking that it would be interesting and productive for Nokians to do a
trawl of WONTFIXes and add but if I were going to fix it, this is where I'd
start... and then possibly work with us on re-assigning them to an appropriate
Mer category...


David


-- 
Don't worry, you'll be fine; I saw it work in a cartoon once...
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: WONTFIX BUGS.... was Re: Default nice value setting

2009-06-17 Thread Andre Klapper
Am Mittwoch, den 17.06.2009, 10:15 +0100 schrieb David Greaves:
 Just thinking that it would be interesting and productive for Nokians to do a
 trawl of WONTFIXes and add but if I were going to fix it, this is where I'd
 start... and then possibly work with us on re-assigning them to an 
 appropriate
 Mer category...

It's always a question of time for Nokia developers I guess, but it
can't hurt.

andre
-- 
Andre Klapper (maemo.org bugmaster)

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Default nice value setting

2009-06-17 Thread Nick Nobody
On June 17, 2009 05:03:32 am Frantisek Dufka wrote:
 Henrik Hedberg wrote:
  If it is really crucial for the application to have higher priority,
  maybe it could be installed as setuid root. In that way, it could first
  set priority from 0 to -1, and then drop the privileges.

 Or postinstall script could add some helper to sudoers which could raise
 priority when started from inside the application. I think Vagalume uses
 this trick.

Thanks guys for all the clever solutions to the problem.

@Frantisek I'm using OS2008 version 5.2008.43-7 but like you said that bug 
probably won't get fixed. And for applications that need to go from -1 to 0 
that's very easy, it's probably not even worth fixing...

Thanks again,

nick
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers