Skip to main content
deleted 1 character in body
Source Link

Assume that you have an application that upon startup creates a unix domain socket and starts listening to it. Then any subsequent instance of the application connects to that socket and informs, passes data to the 1st instance and exits (or just exits if it detects another instance running).

As far as I understand it, this kind of socket is represented as a file on the filesystem. Let's assume that this file gets deleted by a random 3rd party program or by the user. Now subsequent processes won't be able to detect/communicate with the 1st instance.
Can the 1st somehow detect the deletion of the socket-file and then recreate it?

Assume that you have an application that upon startup creates a unix domain socket and starts listening to it. Then any subsequent instance of the application connects to that socket and informs passes data to the 1st instance (or just exits if it detects another instance running).

As far as I understand it, this kind of socket is represented as a file on the filesystem. Let's assume that this file gets deleted by a random 3rd party program or by the user. Now subsequent processes won't be able to detect/communicate with the 1st instance.
Can the 1st somehow detect the deletion of the socket-file and then recreate it?

Assume that you have an application that upon startup creates a unix domain socket and starts listening to it. Then any subsequent instance of the application connects to that socket, passes data to the 1st instance and exits (or just exits if it detects another instance running).

As far as I understand it, this kind of socket is represented as a file on the filesystem. Let's assume that this file gets deleted by a random 3rd party program or by the user. Now subsequent processes won't be able to detect/communicate with the 1st instance.
Can the 1st somehow detect the deletion of the socket-file and then recreate it?

deleted 83 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 237

This may be a stupid question but I am a noob with linux and its low level API.

Assume that you have an application that upon startup creates a unix domain socket and starts listening to it. Then any subsequent instance of the application connects to that socket and informs passes data to the 1st instance (or just exits if it detects another instance running).

As far as I understand it, this kind of socket is represented as a file on the filesystem. Let's assume that this file gets deleted by a random 3rd party program or by the user. Now subsequent processes won't be able to detect/communicate with the 1st instance.
Can the 1st somehow detect the deletion of the socket-file and then recreate it?

This may be a stupid question but I am a noob with linux and its low level API.

Assume that you have an application that upon startup creates a unix domain socket and starts listening to it. Then any subsequent instance of the application connects to that socket and informs passes data to the 1st instance (or just exits if it detects another instance running).

As far as I understand it, this kind of socket is represented as a file on the filesystem. Let's assume that this file gets deleted by a random 3rd party program or by the user. Now subsequent processes won't be able to detect/communicate with the 1st instance.
Can the 1st somehow detect the deletion of the socket-file and then recreate it?

Assume that you have an application that upon startup creates a unix domain socket and starts listening to it. Then any subsequent instance of the application connects to that socket and informs passes data to the 1st instance (or just exits if it detects another instance running).

As far as I understand it, this kind of socket is represented as a file on the filesystem. Let's assume that this file gets deleted by a random 3rd party program or by the user. Now subsequent processes won't be able to detect/communicate with the 1st instance.
Can the 1st somehow detect the deletion of the socket-file and then recreate it?

Source Link

Detect unix domain socket deletion?

This may be a stupid question but I am a noob with linux and its low level API.

Assume that you have an application that upon startup creates a unix domain socket and starts listening to it. Then any subsequent instance of the application connects to that socket and informs passes data to the 1st instance (or just exits if it detects another instance running).

As far as I understand it, this kind of socket is represented as a file on the filesystem. Let's assume that this file gets deleted by a random 3rd party program or by the user. Now subsequent processes won't be able to detect/communicate with the 1st instance.
Can the 1st somehow detect the deletion of the socket-file and then recreate it?