I want to give sudo permission which does not ask a password while executing the script. The problem I face is I have to provide the process ID as argument while running the script. I have tried in visudo
the following entry, but it fails and tells no permission to execute the command:
user ALL = (root) NOPASSWD: /usr/java/jdk1.7.0_25/bin/jstack 21580
I have tried this also:
user ALL = (root) NOPASSWD: /usr/java/jdk1.7.0_25/bin/jstack
jstack
is the script to be executed and 21580
is the process ID of java
which gets changed randomly when do a service restart.
But it is not working. Can anyone help me with this?