cancel
Showing results for 
Search instead for 
Did you mean: 

starting saprouter automatically when system reboots

Former Member
0 Kudos

Hi All,

Everytime i have to start the saprouter manually because i configured saprouter using the user sncadm.

I make changes in startsap for starting the saprouter automatically when server startsup.

At the time of startsap its asking the password, either i have to bypass the password for sncadm or we have to start using the snadm or root user.

How to create the daemon on UNIX for saprouter as a service, whenever system reboots saprouter should be up.Can any one give me the procedure.

Thanks and Regards,

Sridhar

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Write a boot script which is executed by root and uses the command

su - c sncadm "<Start_command_of_saprouter>"

Then the root user will bypass the password challenge and start the saprouter everytime the system is started.

Kind regards.

Former Member
0 Kudos

Hi Sven,

Thanks for your reply, you mentioned bootscript means /etc/rc0.d file or some where?

Thanks and Regards,

Sridhar M.

Former Member
0 Kudos

Exactly - but use the path /etc/rc3* or /etc/rc5* depeding on the runlevel you use for your server (runlevel 3 is wihtout GUI - runlevel 5 is with GUI).

former_member524429
Active Contributor
0 Kudos

Dear Sridhar,

If you want to start the SAProuter on the same computer used for an SAP instance, insert the following line into file /usr/sap/<SID>/SYS/exe/run/startsap:

#
# 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

Note:- Insert the lines before the commands to start the SAP instance.

If you want to start a SAProuter on a different computer, then you would have to change file /etc/rc.

The system initialization scripts are contained in /etc/rc<n>.d directories, where u201Cnu201D is the operating system run-level. These directories contain scripts that begin with a K or S, followed by a number.All scripts that begin with u201CSu201D are executed at system startup in ascending order of their number. Scripts beginning with u201CKu201D (Kill) are called at system shutdown time.

Place your script with the command line suggested by Dinter, with its appropriate sequence number (based on your strartup priority). (The script with highest sequence number will be called in last. Likewise, the kill scripts should have a appropriate low sequence number in order to shutdown it early in the process, if its having any dependency.)

Regards,

Bhavik G. Shroff

Former Member
0 Kudos

I suggest to use the highest start number - just to be sure everything else has already been started.

Kind regards.

Former Member
0 Kudos

Dear Sven,

As you told i added the script in boot script, but is not started.

su - sncadm "$SRDIR/saprouter -r ....." (we added this thing in /etc/rc0.d/ file.

Is there any way to start the saprouter even if the user logged off also.

Thanks and Regards,

Sridhar

Former Member
0 Kudos

Looks like you chose the wrong runlevel -

>

> su - sncadm "$SRDIR/saprouter -r ....." (we added this thing in /etc/rc0.d/ file.

Please use runlevel 3 and 5 by adding the script to /etc/rc3.d/ and /etc/rc5.d/

Kind regards.

Former Member
0 Kudos

Hi Sridhar,

Please, try with the following syntax into your runlevel 3 (/etc/rc3.d/)

> su sncadm -c "/usr/sap/saprouter/saprouter -r &"

Thanks,

Federico Biavati