[sudo-users] syntax error

Paul Cantle paul at cantle.me
Wed Jul 20 14:25:17 EDT 2011


Hi,

Try removing the space between the $( and the ps -ef statement.

It should be $(ps -ef, etc, etc)

This will be for all of your statements.

It doesn't look like a sudo issue to me, just syntax error within the
script.

Try it out.

Paul






On 20/07/2011 19:12, "LaComa, Lyn" <Lyn.LaComa at inova.org> wrote:

>Recently installed sudo 1.8.1p2 on AIX 6.1.0.0.
>
>Is working for original purpose of security user adding other users,
>with specific commands specified in sudoers.
>
> 
>
>Problem with a runas_alias for a specific user (lawson)  to run a script
>to start an application.
>
>Root can run the script with no problem, of course.
>
> 
>
>Part of  sudoers:
>
># Run as alias specification
>
>Runas_Alias  LAW = root
>
> 
>
>lawson ALL = (LAW) NOPASSWD: /prod/scripts/lawstart.sh
>
>lawson ALL = (LAW) NOPASSWD: /prod/scripts/lawstop.sh
>
> 
>
>beginning of script setting up variables:
>
>$ more lawstop.sh
>
>## Sample Shut Down Script with Correct Order ##
>
>PATH=/opt/IBM/ldap/V6.2/sbin:/opt/IBM/ldap/V6.2/bin:$PATH
>
> 
>
># Kill WebSphere DataStage RMI Server process
>
>PID=$( ps -ef | grep -v grep| grep rmiserver | awk '{print $2}')
>
>COMPID=$( ps -ef | grep -v grep | grep comsvr | awk '{print $2}')
>
>SMTPPID=$( ps -ef | grep -v grep | grep SmtpAgent | awk '{print $2}')
>
> 
>
> 
>
>Results when trying to execute via sudo:
>
>$ sudo -D 9 ./lawstop.sh
>
>sudo: settings: debug_level=9
>
>sudo: settings: progname=sudo
>
>sudo: settings: network_addrs=10.160.32.60/255.255.255.0
>
>sudo: sudo_mode 1
>
>sudo: policy plugin returns 1
>
>sudo: command info: umask=022
>
>sudo: command info: command=/prod/scripts/lawstop.sh
>
>sudo: command info: runas_uid=0
>
>sudo: command info: runas_gid=0
>
>sudo: command info: runas_groups=0,2,3,7,8,10,11,206,207,208
>
>sudo: command info: closefrom=3
>
>sudo: command info: set_utmp=true
>
>/prod/scripts/lawstop.sh: Syntax error at line 5: `PID=$' not expected.
>
>sudo: received signal 20
>
>sudo: calling policy close with wait status
>
> 
>
> 
>
>any ideas?
>
> 
>
>____________________________________________________________
>sudo-users mailing list <sudo-users at sudo.ws>
>For list information, options, or to unsubscribe, visit:
>http://www.sudo.ws/mailman/listinfo/sudo-users





More information about the sudo-users mailing list