run sh script in redmine false

Added by jp qu about 1 year ago

hi:
I tried to run sh script in redmine like this: **************************************
cmd = "/usr/bin/sudo /root/test.sh" + " 1>&2"
result = system(cmd)
logger.error "result = #{result}" **************************************
I got result value is false,but when I run this code in the test.rb script with same code,I got true,I don't know why.It is totally same code.
test.sh script just echo "run this script"
how can I run sh script in redmine? please help me !!!

redmine version: 2.4.2-1
ruby version:1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
rails version: 3.2.16