Configure a standalone Driver
Set the connection, task, and integration parameters of a standalone Driver with its state file, a configuration file, environment variables, or flags.
A standalone Driver reads its parameters from five sources. A source higher in the list overrides the sources below it:
- Command line flags. See the CLI reference.
- Environment variables.
- A configuration file.
- The state file, which
synnax-driver loginwrites. - The defaults.
The parameter flags and the configuration file apply only to
synnax-driver start --standalone. The service always starts with the same command. To
configure the service, use login and, except on Windows, the
environment file. On Linux, run login once, also when the
environment file holds the connection: login creates the state file, and the service
user cannot.
State file
The state file holds the connection parameters and the API key that login saves. Only
its owner and the administrators can read it. On Windows and macOS, while the service is
installed, every command uses the path of the computer, so run each command with admin
rights. Without the service, commands use the path of the user.
install moves the login and the OPC UA certificates in the path of the user to the
path of the computer, when the path of the computer holds no login yet.
The --state-file flag of start --standalone, login, and clear sets a different
path. The service always uses the default path.
To remove the saved login, run synnax-driver clear. Run login again before the next
start.
Environment variables
The Driver reads each parameter from a variable named SYNNAX_DRIVER_ and the key in
upper case. The integrations have no variable.
SYNNAX_DRIVER_HOST=10.0.0.45
SYNNAX_DRIVER_PORT=9090
SYNNAX_DRIVER_API_KEY=syk_...
SYNNAX_DRIVER_SECURE=false
SYNNAX_DRIVER_CORRECT_SKEW=true
SYNNAX_DRIVER_OP_TIMEOUT=60
SYNNAX_DRIVER_POLL_INTERVAL=1
SYNNAX_DRIVER_SHUTDOWN_TIMEOUT=30
SYNNAX_DRIVER_WORKER_COUNT=4To learn what each parameter does, see Parameters.
Environment file
On Linux, NI Linux Real-Time, and macOS, the service and login read
/etc/synnax/driver.env. Write one KEY=value on each line, with no export. login
uses the file only for variables such as GRPC_DEFAULT_SSL_ROOTS_FILE_PATH. It does not
read the SYNNAX_DRIVER_ variables. On macOS, login reads the file only while the
service is installed.
install creates the file. Only root can read it, so edit it and run login as root:
with sudo on Linux and macOS, and as admin on NI Linux Real-Time. Restart the
service after you edit the file.
start --standalone does not read the file. For a Driver in a terminal, export the
variables in the shell:
export SYNNAX_DRIVER_WORKER_COUNT=8
synnax-driver start --standaloneConfiguration file
Give a JSON file to start --standalone with the --config flag. Each key is optional.
The file cannot hold comments.
{
"connection": {
"host": "10.0.0.45",
"port": 9090,
"api_key": "syk_...",
"secure": false
},
"timing": {
"correct_skew": true
},
"manager": {
"op_timeout": 60,
"poll_interval": 1,
"shutdown_timeout": 30,
"worker_count": 4
},
"integrations": ["arc", "ethercat", "http", "labjack", "modbus", "ni", "opc"]
}The integrations list replaces the default list.
A Driver with no API key logs in once with username and password, creates a rack and
its API key, and saves the key in the state file. An upgraded Driver that saved a rack
before does this at its first start and keeps its rack. If that user cannot create
racks, the Driver keeps logging in with the password and tries again at each start. Once
a key is saved, the Driver ignores a username and password and logs a warning.
Parameters
host= localhostThe host of the Core.
port= 9090The port of the Core.
api_key= ""The API key of the Driver’s rack. The Driver logs in as that rack.
username= synnaxThe username to log in with once, to create a rack and its API key. Ignored when an API key is set.
password= seldonThe password to log in with once, to create a rack and its API key. Ignored when an API key is set.
secure= falseConnect to the Core over TLS.
correct_skew= trueKeep the timestamps of hardware-timed NI and LabJack reads in step with the clock of the computer.
op_timeout= 60The number of seconds after which a task operation that has not finished, such as a start, gives the task the error
operation timed out.poll_interval= 1The number of seconds between two checks for task operations that have not finished.
shutdown_timeout= 30The number of seconds that the Driver waits for task operations when it stops.
worker_count= 4The number of threads that run task operations. Use a value from 1 to 64.
integrations= allThe device integrations to run:
arc,ethercat,http,labjack,modbus,ni, andopc. NI Linux RT has nomodbus.
For a boolean environment variable, use true or false.