I have written an "su" wrapper script which limits which users can switch, to which accounts. It all works very well until I call it as part of my Serviceguard package. The only line that is significant is:
su "$@"
This calls the real "su" from my script. If it is passed the following command (from Serviceguard), I get an "su" usage error:
su_script - iaa -c "/appl/iaa/bin/iaa &" > /dev/null 2&1
The problem appears to be that the "$@" is parsed differently when run from Serviceguard, than from a regular shell prompt. I suspect that this is a really obvious and stupid problem, and the answer will be staring me in the face. The log produced by tracing my script in the foreground shows:
+ Update_log User:co1217 switches to iaa
+ Update_log Command is: "/usr/sbin/su.orig - iaa -c /appl/iaa/bin/iaa &"
+ Update_log Script Completed!
+ print -u4 - =================
+ exec
+ 4> -
+ /usr/bin/su.orig - iaa -c /appl/iaa/bin/iaa &
whereas from Serviceguard, the "su.orig" gives a usge error for each of the arguments.
Any ideas????
su "$@"
This calls the real "su" from my script. If it is passed the following command (from Serviceguard), I get an "su" usage error:
su_script - iaa -c "/appl/iaa/bin/iaa &" > /dev/null 2&1
The problem appears to be that the "$@" is parsed differently when run from Serviceguard, than from a regular shell prompt. I suspect that this is a really obvious and stupid problem, and the answer will be staring me in the face. The log produced by tracing my script in the foreground shows:
+ Update_log User:co1217 switches to iaa
+ Update_log Command is: "/usr/sbin/su.orig - iaa -c /appl/iaa/bin/iaa &"
+ Update_log Script Completed!
+ print -u4 - =================
+ exec
+ 4> -
+ /usr/bin/su.orig - iaa -c /appl/iaa/bin/iaa &
whereas from Serviceguard, the "su.orig" gives a usge error for each of the arguments.
Any ideas????