SAP router services script on linux.
With the script below you will be able to use command :
- “service saprouter start” to start saprouter on linux.
- “
- “service saprouter status
service saprouter stop” to stop saprouter on linux.
” to have status and pid of saprouter on linux.
/etc/init.d/saprouter |
---|
#!/bin/sh . /etc/rc.d/init.d/functions RETVAL=0 basedir=/usr/saprouter SAPROUTERARGS=” -r -R ${config} -G ${logfile} -T ${tracefile} -J 1048576 -Y 12 -C 1000 -W 9000000 “ configtest() { rh_status(){ rh_status_q() { start() { echo -n $”Starting $prog: “ stop() { rh_status_q echo -n $”Shutting down softly $prog: “ [ $RETVAL -eq 0 ] && rm -f $lockfile usage() { if [ $# -gt 1 ]; then case “$1” in exit $? |
usefull command :
to increase trace : saprouter -t -V 2
to see list on client saprouter -l :
Mon Aug 26 13:59:04 2013
SAP Network Interface Router, Version 40.4
Mon Aug 26 13:59:05 2013
peer SAProuter with NI version 40 …
send info-request to running SAProuter …
SAP Network Interface Router running on port 3299 (PID = 4838)
Started on: Mon Aug 26 11:58:00 2013
ID CLIENT | PARTNER service
———————————–+—————————————
8 localhost | (no partner)
76 10.126.104.193 | 10.134.235.67 sapdp00
170 10.126.104.193 | 10.134.235.67 sapdp00
62 10.126.104.193 | 10.134.235.79 3281
130 sapserv3 | 10.134.235.79 3281
81 10.126.104.193 | 10.126.115.14 3200
Total no. of clients: 11
Working directory : /usr/saprouter
Routtab : /usr/saprouter/ACL/saprouter.tab
Thanks a lot for this perfect script
Thanks Jean Philippe. It seems we have already meet. Isn't it? For Nigeria affiliate?
Oh YES š
Hi Mathieu GRAVIL
I`ve created your script here, but here on SUSE Linux 12 does not exit the path script ". /etc/rc.d/init.d/functions" line 20.
Could you can help me ?
Kind Regards
I know this is a bit old thread but in case others have a similarĀ problem ..
SLES 12 does not use "init" anymore. It has been replaced by the systemd. Ā If you will need to create what's called a "Unit" file in the /etc/systemd/system folder.
Example: (starting a python script)
[Unit]
Description=Testing some service
[Service]
ExecStart=/usr/bin/python /sapinstall/web.py
[Install]
WantedBy=multi-user.target
Save the file as test.service
Now you should be able to start the service using the unit file.
systemctl enable test.service
systemct start test.service
Great scripts Cheer!.
For SuSE 12, you can have a look at the scripts onĀ https://github.com/cdavisnz/SAP-Router
Otherwise ...
SuSE 12 for SAP has its on init.d script i.e.Ā https://www.suse.com/documentation/sles-for-sap-12/singlehtml/book_s4s/book_s4s.html#sec.s4s.configure.saprouter
Craig