cancel
Showing results for 
Search instead for 
Did you mean: 

Problem starting SAPRouter

Former Member
0 Kudos

Dear All,

Greetings to all,

I have installed my SAPRouter on my Solution Manager system which runs on SUSE Linux Enterprise Server 10 SP2, i have also installed the certificates and register my SAPRouter with SAP.

I have edited my startsap script and added the below lines so that i can start my SAPRouter at the time of start of SAP server

=====================================================================================================

#

  1. Start saprouter

#

SRDIR=/usr/sap/saprouter

if [ -f $SRDIR/saprouter ] ; then

echo u201C\nStarting saprouter Daemon u201C | tee -a $LOGFILE

echo u201C----


u201C | tee -a $LOGFILE

$SRDIR/saprouter -r -R $SRDIR/saprouttab \

| tee -a $LOGFILE &

fi

======================================================================================================

All works fine with the above changes, but i wanted to run my SAPRouter as an SNC router and this is where i am running into problems and unable to start it as an SNC router thru the startsap script.

So whenever i want to connect to SAP via Solution Manager i am forced to stop my SAPRouter and start it as a SNCRouter (from putty thru my desktop).

But my concern is that i dont want to run it from my frontend and want to run it as a service which doesnt stop when i close my putty window.

I want to know how i can acheive this with my startsap script or i would be happy to start my saprouter as a daemon which starts at the time of OS boot.

How can i set the SNC_LIB and SECUDIR variables into the SIDadm user's enviroment so that i dont need set the path each time i login.

Awaiting for your kind responses.

Thanks and regards

Hunky

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

This is my first post to the SAP forums, I hope you find it helpful! I too struggled with this for a couple of hours, but I have since written a script which will run saprouter WITH SNC support on start up automatically as user root on a stand-alone dedicated virtual machine running RedHat/CentOS 5.7 64bit. The key to making this work is to include several environment variables within the start up script. From what I've been able to determine, the inclusion of these variables are not well documented, but absolutely mandatory. It will start with less variables defined, but nothing will be able to connect to it. Below is the saprouter script for my environment. You will need to customize it if you run saprouter as a separate user. Please note that my script does not have chkconfig status support.

If you find this post helpful, please award me forum points

Instructions:

1) Copy & paste the file below to /etc/init.d/saprouter

2) Execute the following commands as root

ln -s /etc/init.d/saprouter /etc/rc2.d/S99saprouter

ln -s /etc/init.d/saprouter /etc/rc3.d/S99saprouter

ln -s /etc/init.d/saprouter /etc/rc4.d/S99saprouter

ln -s /etc/init.d/saprouter /etc/rc5.d/S99saprouter

ln -s /etc/init.d/saprouter /etc/rc0.d/K01saprouter

ln -s /etc/init.d/saprouter /etc/rc1.d/K01saprouter

ln -s /etc/init.d/saprouter /etc/rc6.d/K01saprouter

chkconfig --add saprouter

Now you can stop/start/check saprouter with the RedHat service command. Saprouter will also now start automatically when the server boots into run levels 2-5 (the redhat default is 5).

#--


START-OF-FILE--


#!/bin/bash

#

  1. $Id: saprouter,v 0.63 2012/02/03 02:09:51 Gruic Exp $

#

  1. rc file for starting saprouter with SNC

#

  1. chkconfig: 2345 99 01

  2. processname: /usr/sap/saprouter/saprouter

  3. description: saprouter

  1. required environment variables for saprouter to work properly, do not prune!

export BASH=/bin/bash

export EUID=0

export HOSTNAME=saprouter

export HOME=/root

export HOSTTYPE=x86_64

export PATH=/usr/sap/saprouter:/usr/NX/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

export LOGFILE=/usr/sap/saprouter/saprouter.log

export SECUDIR=/usr/sap/saprouter

export LD_LIBRARY_PATH=/usr/sap/saprouter

export SNC_LIB=/usr/sap/saprouter/libsapcrypto.so

export EXEDIR=/usr/sap/saprouter

export SRDIR=/usr/sap/saprouter

export HOSTNAME=saprouter

export UID=0

export TERM=xterm

export USER=root

export SHELL=/bin/bash

case "$1" in

start)

if [ -f $EXEDIR/saprouter ] ; then

echo "Starting saprouter......"

cd $EXEDIR

$EXEDIR/saprouter -r -G $LOGFILE -K "p:CN=saprouter,OU=0000XXXXXXX, OU=SAProuter, O=SAP, C=DE" -R $SRDIR/saprouttab &

fi

;;

stop)

echo -n "Stopping saprouter"

$EXEDIR/saprouter -s -K "p:CN=saprouter,OU=0000XXXXXX, OU=SAProuter, O=SAP, C=DE"

;;

check)

$EXEDIR/saprouter -l

;;

restart)

$0 stop

$0 start

;;

*)

echo "Usage: $0 {start|stop|check|restart}"

exit 1

;;

esac

#--


END-OF-FILE--


Former Member
0 Kudos

Hi Hunky,

I would use "screen" option to do this instead of adding it in the startsap script.

Not quite sure though if suse has that. But my Router on Redhat Linux works great with that even though i close my putty sessions.

Cheers........,

Raghu

Former Member
0 Kudos

Hi Hunky,

On startup, are you executing the saprouter program under the <sid>adm account? We use something similar to this in our init scripts:

/usr/bin/su - de1adm "-c /sapmnt/DE1/exe/saprouter -r -R /home/de1adm/saprouttab -V 3 -G routtest -T tracetest -K "p:CN=xxxxx1, OU=0000xxxxx, OU=SAProuter, O=SAP, C=DE""

Hope that helps.

J. Haynes

Former Member
0 Kudos

>

>

> How can i set the SNC_LIB and SECUDIR variables into the SIDadm user's enviroment so that i dont need set the path each time i login.

>

>

I am not sure if you need SECUDIR for saprouter.

If the user who is running saprouter process is using bash, then to set his environment variables you have to put commands like this:

export PATH=$PATH:/usr/sap/saprouter/

export SNC_LIB=/usr/sap/saprouter/libsapcrypto.so

in .profile file in his home directory. If he is using csh then put:

setenv PATH "$:/usr/sap/saprouter/"

setenv SNC_LIB /usr/sap/saprouter/libsapcrypto.so

in .cshrc in his home directory. (Please adjust above paths to match your system.)

To run saprouter with SNC it must be started with -K option: saprouter -r -K <mysncname>:

http://help.sap.com/saphelp_nw70/helpdata/en/4f/992ec6446d11d189700000e8322d00/content.htm