Skip to Content

SAP Router configuration on Linux platform (error in start script)

Hello gurus,

I´m trying to setup the saprouter on Fedora v14 (32 bits).

I did all the configure with root user. The problem is when I run the script that starts the saprouter service, it show me the following error:

[root@saprouter sap]# pwd
/usr/sap/saprouter
[root@saprouter saprouter]# saprouter_start 
/usr/sap/saprouter/saprouter_start: line 12: syntax error near unexpected token `|'
'usr/sap/saprouter/saprouter_start: line 12: `        | tee -a $LOGFILE &

The content of this script, has the following sintaxes:

#
# Start saprouter
# You can automatically start SAProuter when you start the system. In UNIX for example, you would change file /etc/rc.
# saprouter CN=saprouter, OU=0001214237, OU=SAProuter, O=SAP, C=DE sapserv2
#
#
SRDIR=/usr/sap/saprouter
LOGFILE="usr/sap/saprouter/saprouter_log"
if [ -f $SRDIR/saprouter ] ; then
        echo "Starting SAP Router" | tee -a $LOGFILE
$SRDIR/saprouter -r -R $SRDIR/saprouttab -G $LOGFILE -W 60000 -K "p:CN=saprouter, OU=0001214237, OU=SAProuter, O=SAP, C=DE" 
        | tee -a $LOGFILE &
fi

The strange of this is I already did this type of configuration on Linux with the same scripts... but in red hat enterprise linux x86_64 and in there it works perfectly!

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/4f/992ce8446d11d189700000e8322d00/frameset.htm

Can you help me please in way to solve this problem...?!

Best regards,

João Dimas - Portugal

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 08, 2011 at 11:35 PM

    HI...

    I just copy and past you script code and start the saprouter in my machine withtout issue.

    Try to put the last "| tee -a $LOGFILE &" in teh same line of the command

    cahnge from:

    $SRDIR/saprouter -r -R $SRDIR/saprouttab -G $LOGFILE -W 60000 -K "p:CN=saprouter, OU=0001214237, OU=SAProuter, O=SAP, C=DE"

    | tee -a $LOGFILE &

    to

    $SRDIR/saprouter -r -R $SRDIR/saprouttab -G $LOGFILE -W 60000 -K "p:CN=saprouter, OU=0001214237, OU=SAProuter, O=SAP, C=DE" | tee -a $LOGFILE &

    at the same line!

    Cheers,

    Clébio

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Clebio,

      Oh my God... lol finally I understood what´s happened and you know what... you will not believe what happened and why this was happening!... First at all, I do not have much experience in linux and because of that I made a crucial error... I wrote this script file for start and stop saprouter on a Windows machine and then transfer them to Fedora machine! So... in this weekend I tried to delete that files on Linux and create them directly in Linux... and after that, I ran the script without any error!... my God! 😔

      Certainly, this problem was related to some sintaxe/expressions on Windows platform... I found a command that works perfectly for this type of situation which converts the DOS files to Unix files...which can be very useful:

      # dos2unix saprouter_start

      Well, thank you very much Clebio... and sorry for this stupid thing...!

      I will give you maximum points due to the effort that you demonstrated in this situation, you was very kind!

      Best regards,

      João Dimas - Portugal