Why is the nice command failing?

View the output below. As oracle user, you run the following command on your Oracle Linux 6
system:

[oracle@dbhost ~ ] $
[oracle@dbhost ~] $ nice – – 10 ./myscript.sh &
[1] 2735
[oracle@dbhost ~] $ nice: cannot set niceness: permission denied
Why is the nice command failing?

View the output below. As oracle user, you run the following command on your Oracle Linux 6
system:

[oracle@dbhost ~ ] $
[oracle@dbhost ~] $ nice – – 10 ./myscript.sh &
[1] 2735
[oracle@dbhost ~] $ nice: cannot set niceness: permission denied
Why is the nice command failing?

A.
Shell scripts cannot be assigned a negative nice value.

B.
There is already another process running with same niceness value on this system.

C.
A negative nice value can be set by the root user.

D.
A nice value of -10 is not the permissible niceness range.

Explanation:
Only a privileged user may run a process with lower niceness:
$ nice -n -1 nice
nice: cannot set niceness: Permission denied
0
$ sudo nice -n -1 nice
-1
Note:Sudo stands for either “substitute user do” or “super user do” (depending upon how you want
to look at it). What sudo does is incredibly important and crucial to many Linux distributions.
Effectively, sudo allows a user to run a program as another user (most often the root user).



Leave a Reply 0

Your email address will not be published. Required fields are marked *