cancel
Showing results for 
Search instead for 
Did you mean: 

Saprouter automatic startup with OS restart

Former Member
0 Kudos

Hi All,

We are using saprouter 7.10 Patch level 4 on Linux x86_64 64bit.

We execute below command to start saprouter:

nohup ./saprouter -r &

No issue is several times we have downtimes So we want to include this command in OS startup-shutdown procedure so that during downtimes saprouter automatically get stop and start.

For it, We have below two challenges:

1) First OS startup is taken care by root user So If I include this same command, router will be startup root user only. But We have one user saproutr which is used for router setup and we want to execute router startup with this user only So please suggest what changes I need to make in router start command.

2) At this time to start saprouter I go to same directory where this executable is available So I think I need to add some environment variable to execute this commnd from any directory.

Please suggest me for these points.

Shivam Mittal

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

If you have sudo installed you can try the following:

sudo -i -u saproutr /saprouter &

I'm not 100% sure that you will actually need the & and the nohup. You can try with and without...

Cheers,

Maurício

Former Member
0 Kudos

Hi Shivam,

Just include the following line to /etc/rc.d/init.d as root.

su - saproutr -c "nohup <absolute_path>/saprouter -r &"

saprouter process should auto start from the next time with User saproutr as you wanted.

No need to worry about the point 2 as the process runing in the environment of saproutr.

Get help from your Unix team if you don't have root.

BTW, which version of linux are you using?

Br,

Venky

Former Member
0 Kudos

Hi Venkatesh,

Thank you very much for your reply,I tried to execute this command:

su - saproutr -c "nohup ./usr/sap/saprouter/saprouter -r &"

But first thing this command is asking saproutr user password.

Second command output is

nohup: cannot run command `./usr/sap/saprouter/saprouter': No such file or directory

While this file is available in this directory.

Normally I use command nohup ./saprouter -r &

Please let me what wrong I am doing.

My OS version is

Red Hat Enterprise Linux Server release 5.7 (Tikanga)

Please let me know if you have any more suggestion also.

Shivam

Former Member
0 Kudos

The following thread has a good suse init script that you could adjust to your liking:

http://forums.sdn.sap.com/thread.jspa?threadID=1762992

Or, you can just add the starting of the saprouter to:

/etc/rc.d/rc.local

Former Member
0 Kudos

Hi Shivam,

Login as root

vi /etc/rc.local

su - saproutr -c "/usr/sap/saprouter/saprouter -r &"

This should run fine.

Br,

Venky

Former Member
0 Kudos

try

vi /etc/rc.local

su -c "/usr/sap/saprouter/saprouter -r &" saproutr