Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member230159
Contributor
5,153
Greetings for the day!

 

I recently came across this question of
" Can we somehow change the location of /tmp/.sapstream<port-number> sockets to some other location that /tmp/.. location ? "

The answer to this question is "No , we cannot."  😐

First lets just look at what are unix domain sockets.?

There are critical functions (also called as "protected webmethods " such as restarting an instance or maybe stopping an instance ) must be called via trusted connections and they require authentication with operating system user and password. On UNIX platforms trusted connections go through UNIX domain sockets (/tmp/.sapstream<port-no>).

[ Want to know more about 'protected web methods ' .. check this link "Protected webmethods " ]

TIP : To check the UDS the following command could be used :

-> cd /tmp

-> ls -al /tmp/.sapstream*

This will list all the available sapstream in the /tmp directory.

As an example ( this is from my test system 😉 )

-> cd /tmp

-> ls -al /tmp/.sapstream*

srwx 1 SIDadm sapsys 0 Aug 27 15:32 /tmp/.sapstream50013
srwx 1 SIDadm sapsys 0 Aug 27 15:32 /tmp/.sapstream50014
srwx 1 SIDadm sapsys 0 Aug 27 15:32 /tmp/.sapstream50113
srwx 1 SIDadm sapsys 0 Aug 27 15:32 /tmp/.sapstream50114

[....]

srwx 1 SIDadm sapsys 0 Aug 27 15:32 /tmp/.sapstream50213
srwx 1 SIDadm sapsys 0 Aug 27 15:32 /tmp/.sapstream50214
srwx 1 SIDadm sapsys 0 Aug 27 15:32 /tmp/.sapstream50313
srwx 1 SIDadm sapsys 0 Aug 27 15:32 /tmp/.sapstream50314

Here 's' stands for socket .

Now let us look at why it is not possible to move the UDS to another location..

The reason for this is because the unix domain sockets are automatically created by the sapstartsrv process when the sapstartsrv process is started (or when the sap system is started ). These have a set and predefined location and they will be created in the /tmp/ directory.

Initially I thought maybe we can create a symbolic link to the /tmp and then redirect these sockets to some other location but I failed to start my system (maybe there could be other reasons as well...but the most probable cause was this) and moreover when I checked the link was not even generated correctly ( it was some crazy behavior..but atleast I came to know what to do in such case 😉 )

The standard situation ( " BY DESIGN " ) is sapstream (UDS) will be created in /tmp directory then why should I want to move this to some other location at all?
The reason for this is sometimes the sapstream files are not deleted automatically ( ideally they should be after the instance is stopped ) but somehow they remain in the /tmp which causes the /tmp directory to grow in size!

We also have a solution for this 😉
"Manually remove them "

Can we ?

BUT( there is a big "but" here ) !

TIP :Please Ensure this is done only when the system is stopped..

 

The following commands could be used:

  1. rm .sapstream5<NN>13  // this will remove the sapstream*

  2. cleanipc <NN> remove  // this will cleanup the shared memory segments.


 

/* NN stands for instance number */

 

 

In case it is interesting to find out more about the unix domain sockets please check these links:

SAP Start Service

SAP does not start

 

 

Thank you and Best regards,

Manjunath Hanmantgad