Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

In a server I want all user processes to have 25 as default priority.

My solution was to include the following config in /etc/profile

if [ $USER  != "root" ]; then 
   renice 5 -p $PID $$
fi

There are two problems with this solution:

  • if the user runs the command directly from ssh then the default priority is 20.

    Example: ssh mysuser@host.com command.sh command.sh runs with priority 20.

  • if the user uses another shell (zsh for example) default priority isn't being changed.

Any sugestions on how set the default priority for all shells (and for running ssh commands)?

Thanks

share|improve this question

1 Answer 1

pam_limits module provides ability to set various restrictions on per-user/per-group selection. You should check man limits.conf for priority.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.