-- PaulGrenz - 25 Sep 2020

Symlinks: Why we use them and what they are good for

The indiserver starts, stops, and manages all the INDI drivers, and as such, we cannot specify any command line options. This makes running several instances of one executable difficult, To put it another way, there is no straightforward way to have the same binary run a different configuration.

This is where symlinks come in.

By making a symlink to an underlying executable and running that executable from that symlink, we effectively run that executable using another name. Since this alternate name is accessible from the binary itself, we have a unique name to use to load a config file.

- For example:

Symlink Usage
INDI Symlink Usage Example

Here, we have a binary executable called "indi_maxnet". It is a generic piece of software which talks to a motor controller consisting of several motors at a particular IP address. By creating three symlinks to it with different names, indiserver can run the same driver three times as though each was a different binary. Since each instance running has a different name, the underlying driver can use this information to generate the name of a unique config file to load. In the case of the "aux_motors" symlink, the "indi_maxnet" driver can interrogate the command line it was invoked with, get the name "aux_motors" and look for a config file called "aux_motors.conf". In this way, each instance of the driver can connect to a different IP address and have different motor parameters.

This methodology is used many times with INDI in order to reuse functionality many times without rewriting drivers for each new instance.
Topic revision: r4 - 29 Sep 2020, PaulGrenz
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback