not able to copy socket/inode file

I having the file called ‘live’ in ubuntu, this is the socket/inode type file. This file has the permission as

srw-rw-r-- live

I want to create the copy of the file.

I not able to copy it using cp command from terminal.

Pls anyone tell me how to copy this file or else how to create new socket/inode file in ubuntu.

This file used in check_mk monitoring console.

Thanks….

Answer

A Unix socket is not a “file” in the way you are thinking.

This file doesn’t contain a fixed amount of data which you can copy onto another location. It’s not like creating a text file and ending up with myfile.txt which doesn’t change until you open it again.

Think of the socket file as a “window” into the application, and the data which that window contains will change as the application runs.

If you wish to view what is happening in this socket, you can use socat to intercept the data flow in realtime. For example:

https://stackoverflow.com/questions/16045046/how-to-fork-transferred-data-to-a-script-with-socat

Attribution
Source : Link , Question Author : sujin , Answer Author : Community

Leave a Comment