script for automatic renice command
Hi!
I have N810. How can I write a short script to do the following? Get the pid of a process like: ps | grep <your_app_name> | cut -b 1-5 | head -1 and then use that pid number in the 'renice' command to put the priority higher like: renice -20 -p 1735 |
Re: script for automatic renice command
Quote:
Code:
renice -20 $(pidof appname) |
Re: script for automatic renice command
Hi thanks!
Can you write down the whole code that I should put into a script file? I guess first the script should find out the pid# and then in the next line use that pid# with the renice command. I could execute that automatically. |
Re: script for automatic renice command
The above is the whole code.
Code:
#!/bin/sh ./wahtever you want.sh appname |
Re: script for automatic renice command
ok, but renice command needs root. if i put root into script then it enters root but it continues the script only when i type exit from root.
|
Re: script for automatic renice command
Use:
Code:
sudo renice -20 $(pidof $1) |
Re: script for automatic renice command
Ok, I have found directory: /etc/sudoers.d
It has 7 files. I made a copy but I dont know the path of renice. whereis command does not work. How to find out? and where is the ping command located? That needs root also. I also tried to search with Midnight Commander for ping file but it didnt find it. |
Re: script for automatic renice command
Quote:
Quote:
|
Re: script for automatic renice command
Well, I have the following files in /etc/sudoers.d directory:
01sudo flash-and-reboot.sudoers hildon-application-manager.sudoers hildon-input-meth~igurator.sudoers osso-af-startup.sudoers osso-app-killer.sudoers ukeyboard.sudoers The first one has the most lines. So to which one should I include the following line? user ALL = NOPASSWD: /usr/bin/renice I put it into the first file but it still doesn work without root. |
All times are GMT. The time now is 02:13. |
vBulletin® Version 3.8.8