<p>Afternoon,</p>
<p>I have an application that use the account image as service account. I can su to the account 'image' and start or stop it fine.  No root privilege needed. So I am not trying to set it up so that other developers can be able to restart it through sudo and that’s when I realized I am missing something about sudo.</p>

<p>The problem is under "run as" usage. When I look at man page, it imply that "run as" account don't need to be root. Quoting the man page.</p>
<p>Begin quote: <br>
sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. End quote:</p>
<p>On FreeIPA, I have a sudo rule called developers with necessary hostgroups and usergroups. At the bottom is a section titled "AS WHOM" and that’s where I am having a problem. If I use root under RunAs Users section, it works. If I substitute root with account image, I get the following error.</p>

<p>[william@dev18-yyz-int ~]$ sudo service imageserver stop <br>
[sudo] password for william: <br>
Sorry, user william is not allowed to execute '/sbin/service imageserver stop' as root on dev18-yyz-int.jamar.loc.</p>
<p> [william@dev18-yyz-int ~]$ ls -al /etc/init.d/imageserver -rwxr-xr-x. 1 image image 1014 Jan 9 15:38 /etc/init.d/imageserver</p>
<p>[william@dev18-yyz-int ~]$ cat /etc/init.d/imageserver #! /bin/sh</p>
<p>start(){ echo "Starting imageserver.."</p>
<p>eval "runuser - image -c '/usr/local/bin/imageserver.sh &'" }</p>
<p>stop(){ echo "Stopping imageserver.." PIDNUMBER=`ps aux | grep imaginserver | grep -v grep | awk '{print $2}'` echo $PIDNUMBER eval "runuser - image -c 'kill -9 $PIDNUMBER'" }</p>
<p>[william@dev18-yyz-int ~]$ ls -al /usr/local/bin/imageserver.sh -rwxr--r--. 1 image image 89 Jan 9 15:36 /usr/local/bin/imageserver.sh</p>
<p>[williamm@dev18-yyz-int ~]$ cat /usr/local/bin/imageserver.sh #!/bin/bash cd /opt/jamar/application/imaginserver nohup ant run > /dev/null 2>&1 &</p>
<p>Is it possible to use sudo without first needing to go through root  momentary. I suspect this should be possible as sudo "run as" facility wouldn't then make sense otherwise .</p>
<p>So, it would work as follows:</p>
<p>William -> image</p>
<p>Instead of:</p>
<p>William -> root -> image.</p>
<p>Appreciate any advice in advance</p>
<p>William </p>