Run the Core as a service
Start a Synnax Core when the computer boots, and restart it after a failure.
A Synnax Core started from a terminal stops when the terminal closes. As a service, the Core starts when the computer boots and starts again after a crash.
Run the Core as a service
Linux
Windows
Docker
-
Install the Core at
/usr/local/bin/synnax. See Set up Synnax Enterprise. -
Install the service with the flags for the Core:
sudo synnax service install --listen=synnax.example.com:9090 --auto-cert \ --license-file=/etc/synnax/license.licChange
--listento the name that clients use to reach the Core. For a different certificate, see Set up TLS. -
Get the license key for the computer from the portal. Put the
.licfile at/etc/synnax/license.lic, readable by thesynnaxuser:sudo cp synnax.lic /etc/synnax/license.lic sudo chown root:synnax /etc/synnax/license.lic sudo chmod 640 /etc/synnax/license.lic -
Start the service:
sudo synnax service start -
Check that the Core started:
journalctl -u synnax -f -aWait for
Synnax is running and available at.
The install creates the synnax system user, which runs the Core, and the systemd unit
/etc/systemd/system/synnax.service. It writes the flags to /etc/synnax/config.yaml,
which only root and the synnax user can read. The Core keeps its data in
/var/lib/synnax/data, its certificates in /var/lib/synnax/certs, and its log in
/var/lib/synnax/logs/synnax.log. The service starts when the computer boots, unless
you install it with --auto-start=false. When the Core stops, systemd starts it again
after 5 seconds, except after an error that only you can fix, such as a config value
that is not valid. Then systemctl status synnax shows the service as failed. The unit
lets the Core keep many channel files open, and lets Arc automations on the embedded
Driver run on a real-time thread.
To change a flag, edit config.yaml, then run sudo synnax service stop and
sudo synnax service start. For EtherCAT devices, run sudo systemctl edit synnax and
add these lines:
[Service]
AmbientCapabilities=CAP_NET_RAWA unit that you wrote yourself also works with synnax update, if its name is synnax.
The Windows installer installs the Core as a service by default, so you can skip this step if you used it.
-
In PowerShell as an administrator, install the service with the flags for the Core:
synnax service install --listen=synnax.example.com:9090 --auto-cert ` --license-file=C:\ProgramData\Synnax\license.lic -
Start the service:
synnax service start -
Check that it runs:
synnax service status
The service is named SynnaxCore, with the display name “Synnax Core”. It keeps its
settings in C:\ProgramData\Synnax\config.yaml, its data in
C:\ProgramData\Synnax\data, and its log in C:\ProgramData\Synnax\logs\synnax.log.
When the Core crashes, Windows restarts it after 5 seconds, then 30 seconds, then 60
seconds. A Core that stops with an error does not restart.
To change a setting, edit config.yaml, then run synnax service stop and
synnax service start. Running synnax service install again does not change
config.yaml when it exists. For each service command, see the
CLI reference.
Start the container with a restart policy:
docker run -d --name synnax --restart unless-stopped \
--stop-signal SIGINT --stop-timeout 30 --mac-address 02:5a:00:00:00:01 \
--ulimit rtprio=99 -p 9090:9090 -v synnax-data:/synnax/synnax-data \
-v synnax-certs:/usr/local/synnax/certs \
synnaxlabs/synnax --listen=synnax.example.com:9090 --auto-certDocker starts the container when the Docker daemon starts and after a crash.
--stop-signal SIGINT lets the Core shut down cleanly on docker stop, and
--stop-timeout 30 gives it time to finish. The license is bound to the
--mac-address, so keep the same address when you recreate or upgrade the container.
The Core stores a key that you activate from the Console in the synnax-data volume. To
give the key at start instead, add -e SYNNAX_LICENSE_KEY="$(cat synnax.lic)".
--ulimit rtprio=99 lets Arc automations on the embedded Driver run on a real-time
thread. The Core runs as a non-root user in the container, so --cap-add SYS_NICE does
not do this.
On macOS, use Synnax Desktop, which starts the Core with the app.
Monitor the Core
-
Health check -> send
POST /api/v1/connectivity/checkwith an empty JSON body. It needs no login or license, and returns 200 while the Core runs:curl -s -X POST https://synnax.example.com:9090/api/v1/connectivity/check \ -H "Content-Type: application/json" -d '{}'The response has the Core version, its clock time, and its license state. It does not check storage.
-
Disk space -> the Core does not check free space. When the data disk is full, the Core can stop, and the service restarts it again and again. Alert well before the disk fills.
-
Logs -> the Core writes logs to its output and to the file set by
--log-file-path. The file rotates at 50 MB and keeps 5 old files for 30 days. To change these values, see the CLI reference.
Do not start a Core in production with --debug. It serves profiling routes to every
network with no login.